Files
threadcount-community/app/m/(app)/done/page.tsx
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

28 lines
958 B
TypeScript

"use client";
/* The Done screen as its own history entry. A finished hand-over or delivery router.replace()s its
form here (components/SignFlow showDone), so Back skips the spent form, a router refresh re-renders
this screen rather than the form's parent, and a reload still shows what was just recorded. */
import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { DoneScreen, readDone, type DoneProps } from "@/components/SignFlow";
import { MBody, MKick, MRule, MTop } from "@/components/m";
export default function DonePage() {
const router = useRouter();
const [done, setDone] = useState<DoneProps | null>(null);
useEffect(() => {
const d = readDone();
if (d) setDone(d);
else router.replace("/m");
}, [router]);
if (done) return <DoneScreen {...done} />;
return (
<>
<MTop title="Done" />
<MRule />
<MBody pad><MKick>Loading</MKick></MBody>
</>
);
}