Files
threadcount-community/components/people/SignedToggle.tsx
T
ThreadCount c89010a4f1 ThreadCount Community edition
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from f976bd5 on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
2026-09-15 23:18:05 +10:00

17 lines
758 B
TypeScript

"use client";
import { useState } from "react";
import type { IssueRec } from "@/lib/compute";
import type { Act } from "./shared";
/** The receipt tick for one issue line (issue.receipt). Issuers may use it. */
export default function SignedToggle({ issue, what, act }: { issue: IssueRec; what: string; act: Act }) {
const [busy, setBusy] = useState(false);
return (
<button type="button" className={"tc-people-signed" + (issue.receipt ? "" : " no")} aria-pressed={issue.receipt} disabled={busy}
aria-label={`Receipt signed for ${what}`}
onClick={async () => { setBusy(true); await act("issue.receipt", { id: issue.id, receipt: !issue.receipt }); setBusy(false); }}>
{issue.receipt ? "signed" : "not signed"}
</button>
);
}