Files
threadcount-community/components/m/issue/meta.ts
T
ThreadCount 0910bc32c1 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 38e16eb on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
2026-09-16 07:57:54 +10:00

10 lines
471 B
TypeScript

/* The meta line under a person's name on the counter phone: group · number · dept · CC. */
import { ccOf, type Snapshot, type StaffRec } from "@/lib/compute";
export function personMeta(s: Snapshot, st: StaffRec): string {
const cc = ccOf(s, st);
return [st.group, st.num, st.dept, cc && `CC ${cc}`].map((x) => (x || "").trim()).filter(Boolean).join(" · ");
}
export const plural = (n: number, one: string, many = one + "s") => `${n} ${n === 1 ? one : many}`;