7d650e4c10
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from d947f89 on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
25 lines
973 B
TypeScript
25 lines
973 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { currentStaff } from "@/lib/staffsession";
|
|
import { ordersData } from "@/lib/staffdata";
|
|
import OrdersScreen from "@/components/screens/Orders";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function MyOrders({ searchParams }: { searchParams: Promise<{ tab?: string }> }) {
|
|
const sess = await currentStaff();
|
|
if (!sess) redirect("/my/signin");
|
|
const { tab } = await searchParams;
|
|
const { open, done, raised } = await ordersData(sess);
|
|
// Landing from the Messages tab with nothing open should still show the Open tab and its empty
|
|
// state, rather than a list of finished orders nobody asked for. `raised` is what this person
|
|
// typed in for somebody else — the desk's whole day, and now a manager's too.
|
|
return (
|
|
<OrdersScreen
|
|
open={open}
|
|
done={done}
|
|
raised={raised}
|
|
initialTab={tab === "done" ? "done" : tab === "raised" ? "raised" : "open"}
|
|
/>
|
|
);
|
|
}
|