8c86c988c1
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).
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
"use client";
|
|
import { useState } from "react";
|
|
import { useSnap } from "@/lib/client";
|
|
import { PageHead } from "@/components/ui";
|
|
import ToOrder from "@/components/orders/ToOrder";
|
|
import OnTheWay from "@/components/orders/OnTheWay";
|
|
import ThisMonth from "@/components/orders/ThisMonth";
|
|
import RecentOrders from "@/components/orders/RecentOrders";
|
|
import { NewOrder, OrdersStyles } from "@/components/orders/bits";
|
|
|
|
export default function OrdersPage() {
|
|
const { isAdmin } = useSnap();
|
|
const [dlg, setDlg] = useState<null | "stock" | "staff">(null);
|
|
return (
|
|
<section>
|
|
<OrdersStyles />
|
|
<PageHead title="Orders">
|
|
<button type="button" className="btn btn-onink" onClick={() => setDlg("staff")}>Order for a person</button>
|
|
<button type="button" className="btn btn-primary" onClick={() => setDlg("stock")}>New order</button>
|
|
</PageHead>
|
|
<div className="tc-orders-grid">
|
|
<div className="tc-orders-toorder">{isAdmin ? <ToOrder /> : <RecentOrders />}</div>
|
|
<div className="tc-orders-otw"><OnTheWay /></div>
|
|
<div className="tc-orders-month"><ThisMonth /></div>
|
|
</div>
|
|
{dlg && <NewOrder onClose={() => setDlg(null)} initOrderFor={dlg === "staff" ? "Staff Member" : undefined} />}
|
|
</section>
|
|
);
|
|
}
|