'use client'; import type { DriverDTO } from '@gridpilot/racing/application/dto/DriverDTO'; import Card from '../ui/Card'; import ProfileHeader from '../profile/ProfileHeader'; import ProfileStats from './ProfileStats'; import CareerHighlights from './CareerHighlights'; import DriverRankings from './DriverRankings'; import PerformanceMetrics from './PerformanceMetrics'; import { getDriverTeam } from '@/lib/racingLegacyFacade'; import { getDriverStats, getLeagueRankings } from '@/lib/di-container'; interface DriverProfileProps { driver: DriverDTO; } export default function DriverProfile({ driver }: DriverProfileProps) { const driverStats = getDriverStats(driver.id); const leagueRank = getLeagueRankings(driver.id, 'league-1'); const performanceStats = driverStats ? { winRate: (driverStats.wins / driverStats.totalRaces) * 100, podiumRate: (driverStats.podiums / driverStats.totalRaces) * 100, dnfRate: (driverStats.dnfs / driverStats.totalRaces) * 100, avgFinish: driverStats.avgFinish, consistency: driverStats.consistency, bestFinish: driverStats.bestFinish, worstFinish: driverStats.worstFinish, } : null; const rankings = driverStats ? [ { type: 'overall' as const, name: 'Overall Ranking', rank: driverStats.overallRank, totalDrivers: 850, percentile: driverStats.percentile, rating: driverStats.rating, }, { type: 'league' as const, name: 'European GT Championship', rank: leagueRank.rank, totalDrivers: leagueRank.totalDrivers, percentile: leagueRank.percentile, rating: driverStats.rating, }, ] : []; return (
{driver.bio}
Detailed race history, settings, and preferences are only visible to the driver.
Per-car statistics, per-track performance, and head-to-head comparisons will be available in production.