Polish replays stat into the summary card grid

The replay count was a lone plain-text bar below the three stat cards,
and read oddly as "Replayed 0x" when nothing had been replayed yet.
Fold it into the same 4-tile grid with the same styling, and show "-"
at zero instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzyfRyA7h5rs5SCAahLAWd
This commit is contained in:
2026-08-30 20:31:31 +02:00
co-authored by Claude Sonnet 5
parent 401b9b5033
commit e459ccd0ed
+10 -3
View File
@@ -12,10 +12,14 @@ function formatHours(ms: number): string {
return `${(ms / 3_600_000).toFixed(1)}h`; return `${(ms / 3_600_000).toFixed(1)}h`;
} }
function formatReplays(count: number): string {
return count === 0 ? "-" : `${count}×`;
}
export function SessionsSummaryCards({ summary }: { summary: SessionsSummary }) { export function SessionsSummaryCards({ summary }: { summary: SessionsSummary }) {
return ( return (
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
<div className="grid gap-4 sm:grid-cols-3"> <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
<Card className="bp-glass"> <Card className="bp-glass">
<CardHeader> <CardHeader>
<CardTitle className="text-sm text-muted-foreground">Completed sessions</CardTitle> <CardTitle className="text-sm text-muted-foreground">Completed sessions</CardTitle>
@@ -36,10 +40,13 @@ export function SessionsSummaryCards({ summary }: { summary: SessionsSummary })
{Math.round(summary.avgDurationMs / 60_000)}m {Math.round(summary.avgDurationMs / 60_000)}m
</CardContent> </CardContent>
</Card> </Card>
</div>
<Card className="bp-glass"> <Card className="bp-glass">
<CardContent className="py-3 text-sm text-muted-foreground">Replayed {summary.totalReplays}×</CardContent> <CardHeader>
<CardTitle className="text-sm text-muted-foreground">Replays</CardTitle>
</CardHeader>
<CardContent className="bp-readout text-3xl">{formatReplays(summary.totalReplays)}</CardContent>
</Card> </Card>
</div>
{summary.durationPerDevice.length > 0 && ( {summary.durationPerDevice.length > 0 && (
<Card className="bp-glass"> <Card className="bp-glass">
<CardHeader> <CardHeader>