// --------------------------------------------------------------------------------------------- // sheet/SheetStatusBar.tsx — S72-T65 (instruction 27, ruling R108 g). // // The strip under the grid that shows Average, Count and Sum for two or more selected cells, at // its right end, in Excel's order. The strip keeps its height when it is empty, so selecting // cells never resizes the canvas above it. It matches `customer-grid/summary/SummaryBar.tsx`'s // look (height, type size, muted label, tabular value) and does not import it. // --------------------------------------------------------------------------------------------- import { formatStat } from "./sheetSelectionStats"; import type { SelectionStats } from "./sheetSelectionStats"; import "../styles/sdlc72/sheet-status.css"; interface SheetStatusBarProps { /** Null when fewer than two cells are selected. */ stats: SelectionStats | null; } export default function SheetStatusBar({ stats }: SheetStatusBarProps) { const items: { label: string; value: string }[] = []; if (stats && stats.count > 0) { if (stats.average !== null) items.push({ label: "Average", value: formatStat(stats.average, stats.formatCell) }); items.push({ label: "Count", value: formatStat(stats.count, null) }); if (stats.average !== null) items.push({ label: "Sum", value: formatStat(stats.sum, stats.formatCell) }); } return (