type check

This commit is contained in:
2026-09-16 11:43:26 +05:30
parent 98398894a5
commit 5cb9872037
3 changed files with 2 additions and 34 deletions

View File

@@ -359,40 +359,6 @@ function reasonFor(row: CounterRow): string {
return row.card?.problem.detail ?? 'Reporting late.'; return row.card?.problem.detail ?? 'Reporting late.';
} }
function lastSale(row: CounterRow): string {
const at = row.status?.lastBillAt;
if (!at) return '—';
return `${shortAge(Date.now() - at.getTime())} ago`;
}
<HStack key={row.key} gap={3} align="center" justify="space-between">
<VStack gap={0.5}>
<Text type="label" size="sm" weight="semibold">{row.terminalId} <StateChip state={row.state} /></Text>
<Text type="body" size="sm" color="secondary">{reasonFor(row)}</Text>
</VStack>
<Button label="View" size="sm" variant="secondary" onClick={() => onOpen(row)} />
</HStack>
))}
</VStack>
</VStack>
</Card>
);
}
/** What a person needs to know before walking over. */
function reasonFor(row: CounterRow): string {
if (row.state === 'never') return 'This counter has never recorded a sale.';
if (row.state === 'offline') {
return row.status?.silentForMs == null
? 'No heartbeat received.'
: `Last heard ${shortAge(row.status.silentForMs)} ago.`;
}
if (row.status && row.status.pendingBills > 0) {
const n = row.status.pendingBills;
return `${n} bill${n === 1 ? '' : 's'} taken here have not reached the books.`;
}
return row.card?.problem.detail ?? 'Reporting late.';
}
function lastSale(row: CounterRow): string { function lastSale(row: CounterRow): string {
const at = row.status?.lastBillAt; const at = row.status?.lastBillAt;
if (!at) return '—'; if (!at) return '—';

View File

@@ -846,6 +846,7 @@
line-height: 1.35; line-height: 1.35;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }

View File

@@ -1020,6 +1020,7 @@ main {
color: var(--color-ink-1); color: var(--color-ink-1);
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }