a6f1059ddf
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from a113353 on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
17 lines
758 B
TypeScript
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>
|
|
);
|
|
}
|