import { Badge, Card, CardContent, CardHeader, DataTable, PageHeader, Sparkline, StatCard, StatGroup, type Column, } from '../../index' interface Kpi { label: string value: string change: string trend: 'up' | 'down' | 'neutral' history: number[] } const KPIS: Kpi[] = [ { label: 'Monthly revenue', value: '$48,290', change: '+8.2%', trend: 'up', history: [31, 34, 33, 37, 36, 40, 42, 41, 45, 48], }, { label: 'Active users', value: '2,841', change: '+3.4%', trend: 'up', history: [21, 22, 24, 23, 25, 26, 26, 27, 28, 28], }, { label: 'Conversion rate', value: '4.6%', change: '0.0%', trend: 'neutral', history: [4.5, 4.7, 4.6, 4.5, 4.6, 4.7, 4.6, 4.6, 4.5, 4.6], }, { label: 'Deploy frequency', value: '18/wk', change: '-5.1%', trend: 'down', history: [24, 23, 25, 22, 21, 22, 20, 19, 19, 18], }, ] interface ServiceTrend { name: string requests: string history: number[] } const SERVICE_TRENDS: ServiceTrend[] = [ { name: 'gateway', requests: '1.2M', history: [40, 42, 45, 44, 48, 52, 55, 58, 57, 62] }, { name: 'billing', requests: '384K', history: [22, 21, 23, 22, 24, 23, 25, 24, 26, 25] }, { name: 'auth', requests: '917K', history: [50, 48, 47, 49, 46, 44, 45, 42, 41, 39] }, { name: 'reports', requests: '128K', history: [8, 9, 8, 10, 11, 10, 12, 13, 12, 14] }, ] interface Activity { id: number actor: string action: string target: string status: 'success' | 'failed' time: string } const RECENT_ACTIVITY: Activity[] = [ { id: 1, actor: 'mira', action: 'deployed', target: 'gateway v2.14.0', status: 'success', time: '2 min ago', }, { id: 2, actor: 'jonas', action: 'updated env', target: 'billing / staging', status: 'success', time: '11 min ago', }, { id: 3, actor: 'ci-bot', action: 'deployed', target: 'auth v1.9.3', status: 'failed', time: '24 min ago', }, { id: 4, actor: 'sofia', action: 'invited', target: 'lee@acme.dev', status: 'success', time: '1 hr ago', }, { id: 5, actor: 'ci-bot', action: 'deployed', target: 'reports v0.8.1', status: 'success', time: '2 hrs ago', }, { id: 6, actor: 'mira', action: 'rotated key', target: 'webhooks', status: 'success', time: '3 hrs ago', }, ] const ACTIVITY_COLUMNS: Column[] = [ { key: 'actor', header: 'Actor' }, { key: 'action', header: 'Event', cell: (a) => ( {a.action} {a.target} ), }, { key: 'status', header: 'Status', cell: (a) => ( {a.status} ), }, { key: 'time', header: 'When', align: 'right', cell: (a) => {a.time}, }, ] /** * Recipe: a dashboard overview page. * * Information hierarchy top-down: PageHeader → StatGroup of StatCards * (the at-a-glance KPI row, each pairing trend text with a Sparkline in * the icon slot) → detail widgets in compact Cards — a recent-activity * DataTable and a per-service trend list. Sparklines next to redundant * trend text stay decorative (no aria-label); the standalone ones in the * service list carry one because they are the only trend signal. */ export function DashboardPage() { return (
{KPIS.map((kpi) => ( } /> ))}
{/* The Card already frames this section, so the table drops its own border rather than stacking a second one inside it. */} a.id} pagination={false} bordered={false} />
    {SERVICE_TRENDS.map((service) => (
  • {service.name} {service.requests}
  • ))}
) }