ClosureList
List store Z closures by business day, alongside open tills, with settled cash figures and drawer results.
Import
import { ClosureList, type ClosureRow } from '@tallyui/components';Usage
const rows: ClosureRow[] = closures.map((closure) => ({
closure,
day: closure.businessDay ?? openingDayInStoreTime(closure.openedAt, timezone),
registerName: registerNames.get(closure.registerId),
}));
<ClosureList rows={rows} currency="NZD" timezone={timezone}
onSelect={({ closure }) => openClosure(closure.id)} />Stamp each row with its business day in store time. Days appear newest first and keep the host’s order within each day. Figures use settled cash: a closure with withheld figures shows dashes and suppresses its day total. On narrow screens the figures appear beneath the closure details. The tabs filter the list without changing the scope count or unmounting open sessions.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
rows | readonly ClosureRow[] | required | Closures with business days, optional display names and offline flags |
currency | string | required | Currency of the closure’s minor units |
timezone | string | required | IANA time zone or device for day headings and row times |
now | () => Date | Current time | Clock for Today and Yesterday |
openSessions | number | 0 | Number of open sessions in the slot |
sessionRows | ReactNode | --- | Open session rows beneath Today |
scopeFrom | string | --- | Inclusive start day; open sessions are excluded when both bounds are set and today is outside them |
scopeTo | string | --- | Inclusive end day |
scopeDay | string | --- | For today alone, show “No closures today” when only open sessions exist |
status | ReactNode | --- | Status content between the open sessions and closure rows |
footer | ReactNode | --- | Content at the bottom of the card |
showEmpty | boolean | true | Show the empty-period message |
unknown | boolean | false | Hide the count when the read is unknown |
filter | ClosureFilter | Local, initially all | Controlled tab: all, open or closed |
onFilterChange | (filter: ClosureFilter) => void | --- | Called when a different tab is pressed |
onSelect | (row: ClosureRow) => void | --- | Called when an available row is pressed |