'use client'; import { Box } from '@/ui/Box'; import { Heading } from '@/ui/Heading'; import { Text } from '@/ui/Text'; interface DriverPerformanceOverviewProps { stats: { wins: number; podiums: number; totalRaces: number; consistency: number; dnfs: number; bestFinish: number; avgFinish: number; }; } export function DriverPerformanceOverview({ stats }: DriverPerformanceOverviewProps) { const winRate = stats.totalRaces > 0 ? (stats.wins / stats.totalRaces) * 100 : 0; const podiumRate = stats.totalRaces > 0 ? (stats.podiums / stats.totalRaces) * 100 : 0; const metrics = [ { label: 'Win Rate', value: `${winRate.toFixed(1)}%`, color: 'text-performance-green' }, { label: 'Podium Rate', value: `${podiumRate.toFixed(1)}%`, color: 'text-warning-amber' }, { label: 'Best Finish', value: `P${stats.bestFinish}`, color: 'text-white' }, { label: 'Avg Finish', value: `P${stats.avgFinish.toFixed(1)}`, color: 'text-gray-400' }, { label: 'Consistency', value: `${stats.consistency}%`, color: 'text-neon-aqua' }, { label: 'DNFs', value: stats.dnfs, color: 'text-red-500' }, ]; return ( Performance Overview {metrics.map((metric, index) => ( {metric.label} {metric.value} ))} {/* Visual Progress Bars */} Win Rate {winRate.toFixed(1)}% Podium Rate {podiumRate.toFixed(1)}% ); }