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 2d04e45 on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
This commit is contained in:
ThreadCount
2026-09-16 04:04:31 +10:00
commit 8c86c988c1
424 changed files with 53598 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
"use client";
import Link from "next/link";
import { useState } from "react";
import { ErrorLine } from "@/components/ui";
import { Seg } from "@/components/portal";
import RequestList, { requestCounts, type RequestsPayload } from "@/components/requests/RequestList";
import type { StaffRec } from "@/lib/compute";
export type RequestsHook = { data: RequestsPayload | null; error: string; loading: boolean; reload: () => Promise<void> };
export default function RequestsTab({ st, req }: { st: StaffRec; req: RequestsHook }) {
const [which, setWhich] = useState<"open" | "all">("open");
const counts = req.data ? requestCounts(req.data, { staffId: st.id }) : null;
return (
<div>
<div className="tc-people-filters">
<Seg label="Which requests" opts={["open", "all"] as const} value={which} onChange={setWhich}
labels={{ open: "Open", all: "All" }} counts={counts ? { open: counts.open, all: counts.all } : undefined} />
<div className="tc-people-right">
<Link href={`/app/requests?staff=${encodeURIComponent(st.id)}`} className="btn btn-secondary">Open in the queue</Link>
</div>
</div>
<ErrorLine msg={req.error} />
<div className="tc-pp">
<RequestList staffId={st.id} filter={which} hidePerson title={null} data={req.data} reload={req.reload} />
</div>
</div>
);
}