/** * StatsCards — KPI summary row: total vehicles, in-frame count, avg speed, uptime. */ export default function StatsCards({ latest, pipelineStatus }) { const cards = [ { label: 'Total Detected', value: latest?.total_count ?? '—', unit: 'vehicles', icon: '🚗', color: 'text-blue-400', }, { label: 'In Frame', value: latest?.vehicles_in_frame ?? '—', unit: 'active', icon: '📍', color: 'text-emerald-400', }, { label: 'Avg Speed', value: latest?.avg_speed_kmh != null ? latest.avg_speed_kmh.toFixed(1) : '—', unit: 'km/h', icon: '⚡', color: 'text-yellow-400', }, { label: 'Uptime', value: pipelineStatus?.uptime_seconds != null ? formatUptime(pipelineStatus.uptime_seconds) : '—', unit: '', icon: '🕒', color: 'text-purple-400', }, ] return (