type check
This commit is contained in:
@@ -359,40 +359,6 @@ function reasonFor(row: CounterRow): string {
|
||||
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 {
|
||||
const at = row.status?.lastBillAt;
|
||||
if (!at) return '—';
|
||||
|
||||
@@ -846,6 +846,7 @@
|
||||
line-height: 1.35;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -1020,6 +1020,7 @@ main {
|
||||
color: var(--color-ink-1);
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user