// The board's side rail (status filters with counts, undo/redo, call, sound, settings) and // top bar (here / takeaway / delivery tabs, item totals button, venue clock, zoom). // Plan step 3.2b, from KdsPage.jsx. import { BellRing, CheckCheck, Clock, CookingPot, Flame, Redo2, Settings, Timer, Undo2, Volume2, VolumeX, ZoomIn, ZoomOut } from 'lucide-react' import { useFormat, useTranslation } from '@xenia/i18n' import { KDS, alpha } from '../theme' const STATUSES = [ { key: 'future', Icon: Clock, colour: KDS.fresh }, { key: 'pending', Icon: Timer, colour: KDS.warning }, { key: 'preparing', Icon: Flame, colour: KDS.progress }, { key: 'done', Icon: CheckCheck, colour: KDS.ink }, ] function RailButton({ active, colour = KDS.ink, onClick, disabled, fs, children, testId }) { return ( ) } export function SideRail({ filters, counts, onToggleFilter, soundOn, onToggleSound, canUndo, canRedo, onUndo, onRedo, onSettings, onCall, fontScale = 1 }) { const { t } = useTranslation('terminal') const fs = fontScale const lg = { width: Math.round(24 * fs), height: Math.round(24 * fs) } const sm = { width: Math.round(20 * fs), height: Math.round(20 * fs) } const label = text => {text} const badgeH = Math.round(22 * fs) const group = { display: 'flex', flexDirection: 'column', gap: 2, padding: `2px ${Math.round(8 * fs)}px` } return ( ) } const TABS = ['all', 'here', 'takeaway', 'delivery'] export function TopBar({ tab, counts, onTab, now, fontScale = 1, zoomPercent, onZoom, showSummaryButton, summaryOpen, onToggleSummary }) { const { t } = useTranslation('terminal') const { formatDate, formatTime } = useFormat() const fs = fontScale const tabH = Math.round(36 * fs) const tabR = Math.round(9 * fs) const clockFont = { fontSize: Math.round(14 * fs), fontFamily: KDS.fontNumber } const zoomButton = { width: tabH, height: tabH, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'none', border: 'none', cursor: 'pointer', color: KDS.ink2, borderRadius: Math.round(7 * fs) } const zi = { width: Math.round(15 * fs), height: Math.round(15 * fs) } return (
{TABS.map(key => { const active = tab === key return ( ) })}
{showSummaryButton && ( )}
{formatDate(now, 'dateLong')} {formatTime(now)}
{zoomPercent}%
) }