"use client"; /* The four month-end steps across the top of Reports. Every state comes from monthEnd() in * lib/portalcounts.ts, so Today's checklist and this strip agree. */ import Link from "next/link"; import { useDerived, useSnap } from "@/lib/client"; import { monthEnd } from "@/lib/portalcounts"; import { Icon } from "@/components/portal"; import { shortDate } from "./bits"; const cell: React.CSSProperties = { background: "var(--color-bg)", padding: "14px 18px", minWidth: 0 }; const state: React.CSSProperties = { marginTop: 6, fontWeight: 600, display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }; const inline: React.CSSProperties = { minHeight: 0, padding: 0 }; export default function MonthEndStrip({ month, onJournal, onPrint }: { month: string; onJournal: () => void; onPrint: () => void }) { const { s } = useSnap(); const { L, byId, staffById } = useDerived(); const me = monthEnd(s, L, byId, staffById, month); return (
1 · Deliveries booked in
{me.deliveriesOverdue > 0 ?
{me.deliveriesOverdue} overdue
:
All in
}
2 · Stock take filed
{me.stocktakeFiled ?
Filed {shortDate(me.stocktakeFiled.date)}
:
Not yet ·Start
}
3 · Journal
{!me.stocktakeFiled ?
Ready after the count
: me.unallocated > 0 ?
:
Ready
}
); }