Files
gridpilot.gg/apps/website/components/dashboard/DashboardKpiRow.tsx
Marc Mintel 9894c4a841
Some checks failed
CI / lint-typecheck (pull_request) Failing after 13s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
code quality
2026-01-27 16:30:03 +01:00

36 lines
846 B
TypeScript

import { StatGrid } from '@/ui/StatGrid';
interface KpiItem {
label: string;
value: string | number;
intent?: 'primary' | 'success' | 'warning' | 'critical' | 'high' | 'med' | 'low';
}
interface DashboardKpiRowProps {
items: KpiItem[];
'data-testid'?: string;
}
/**
* DashboardKpiRow
*
* A horizontal row of key performance indicators with telemetry styling.
*/
export function DashboardKpiRow({ items, 'data-testid': testId }: DashboardKpiRowProps) {
return (
<StatGrid
variant="card"
cardVariant="dark"
font="mono"
columns={{ base: 2, md: 3, lg: 6 }}
stats={items.map((item, index) => ({
label: item.label,
value: item.value,
intent: item.intent as any,
'data-testid': `stat-${item.label.toLowerCase()}`
}))}
data-testid={testId}
/>
);
}