Tally UI

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.

PropTypeDefaultDescription
figuresSalesFiguresrequiredThe period's figures from @tallyui/pos, shared by the hero and the cards
currencystringrequiredCurrency of the figures' minor units
cashierName(id: string) => string | undefinedLabel from cashierOptionsNames a cashier id on the Cashiers card; return undefined while names load
onOpenCard(card: SalesCardId) => void—Opens a card's panel
hideCardsSalesCardId[]—Forwarded to SalesCards as hide
allLeftOutbooleanfalseForwarded to SalesCards

On this page