SalesRoom
Lay out the Reports screen's Sales room, with the filters, the hero and the cards over one SalesFigures result.
Import
import { SalesRoom, type SalesFilters } from '@tallyui/components';Usage
const figures = salesFigures(input);
<SalesRoom figures={figures} currency="NZD" timezone={timezone}
filters={filters} onFiltersChange={setFilters}
statusOptions={statusOptions} cashierOptions={cashierOptions} registerOptions={registerOptions}
onOpenCard={openPanel} />The room stacks a SalesFiltersBar, a SalesHero and SalesCards. It takes the figures and the filter state as props; the screen works the figures out and owns the state. Without cashierName, the Cashiers card names a cashier id by its label in cashierOptions. Pass the same cashierName function to SalesCardPanel.
Props
SalesRoomProps extends SalesFiltersBarProps, so it also takes filters, onFiltersChange, timezone, now, earliestDay, statusOptions, cashierOptions and registerOptions.
| Prop | Type | Default | Description |
|---|---|---|---|
figures | SalesFigures | required | The period's figures from @tallyui/pos, shared by the hero and the cards |
currency | string | required | Currency of the figures' minor units |
cashierName | (id: string) => string | undefined | Label from cashierOptions | Names a cashier id on the Cashiers card; return undefined while names load |
onOpenCard | (card: SalesCardId) => void | — | Opens a card's panel |
hideCards | SalesCardId[] | — | Forwarded to SalesCards as hide |
allLeftOut | boolean | false | Forwarded to SalesCards |