import Link from "next/link"; import { DEMO_FACILITY, DEMO_RESET_MINUTES } from "@/lib/demo"; import { CtaBand, SiteNav } from "@/components/site"; import { switches } from "@/lib/switches"; /* Rendered per request, unlike the rest of the site: the demo switch lives in the database now * and can be flipped from the console, and a page cached for a day would keep offering "Enter as * Admin" long after the entry endpoint had started answering 404. */ export const dynamic = "force-dynamic"; export const metadata = { title: "Try the working demo", description: "Open a stocked, fictional hospital linen room and use ThreadCount as an Admin or an Issuer. The same screens run an aged-care home’s store or a clinic’s cupboard. No sign-up.", alternates: { canonical: "/demo" }, }; const CARDS = [ { as: "admin", role: "Admin", who: "Alex Demo · Uniform Coordinator", body: "The coordinator’s view. Settings, the catalogue and prices, the staff register, suppliers, reorder levels, every report and the month-end pack." }, { as: "issuer", role: "Issuer", who: "Sam Demo · Linen Room Assistant", body: "The counter view. Issue stock, record a manager’s approval, run a stocktake, receive a delivery and work through the pickup call list." }, ]; export default async function DemoPage({ searchParams }: { searchParams: Promise<{ signedin?: string }> }) { const sp = await searchParams; /* The same switch the entry endpoint honours (app/api/auth/demo/route.ts), read here too. * * With the demo out of service that endpoint answers a bare JSON 404, so a page that still * offers "Enter as Admin" walks somebody weighing the product onto a white screen of raw JSON * with no nav and no way back. Sign-ups are handled the same way — /auth hides the create-account * form when sign-ups are closed rather than letting the button fail — and the demo has to go * quiet at the same moment its endpoint does. */ const { demoOpen } = await switches(); return ( <>
Working demo

{demoOpen ? <>Have a look around {DEMO_FACILITY}’s linen room. : <>The demo is closed for the moment.}

{demoOpen ? "It is a made-up hospital, but everything in it is real: a stocked shelf, staff on the register, orders still open with the supplier, people waiting on a pickup, and three months of issues behind it. It could as easily be an aged-care home or a day surgery — the shelf, the counter and the screens are the same. Pick a role and have a look around. Nothing to sign up for." : `${DEMO_FACILITY} is a made-up hospital anyone can walk into, and it has been taken out of service for a while. Nothing is wrong with ThreadCount itself, and a facility of your own is unaffected.`}

{sp.signedin === "1" &&
You’re signed in to your own facility. Go to your app, or sign out first to open the demo.
} {demoOpen ? <>
{CARDS.map((c, i) => (
{c.who}
Enter as {c.role}

{c.body}

Open the {c.role} view
))}
How the demo works. Everyone shares the one demo facility, so you might spot someone else’s changes while you are in there. It goes back to the same starting point every {DEMO_RESET_MINUTES} minutes, so feel free to break things. Demo accounts can’t change passwords or users, or wipe the data. Everything else — issuing, ordering, receiving, stocktakes, reports, printing — behaves exactly as it would in your own facility. None of it is real hospital data.
: (
There is nothing to open just now. The shared demo facility is off, so the two role buttons that normally sit here would only lead to a closed door. Until it is back, how it works walks through the same day at the counter, and the feature list covers what is in it. If you would rather be shown around, ask for a look.
)}
Want one of your own? Set up your facility — it takes about a minute, and your catalogue and staff register come in from CSV.
); }