'use client'; import { Standing } from '../../domain/entities/Standing'; import { Driver } from '../../domain/entities/Driver'; interface StandingsTableProps { standings: Standing[]; drivers: Driver[]; } export default function StandingsTable({ standings, drivers }: StandingsTableProps) { const getDriverName = (driverId: string): string => { const driver = drivers.find(d => d.id === driverId); return driver?.name || 'Unknown Driver'; }; if (standings.length === 0) { return (
No standings available
); } return (
{standings.map((standing) => { const isLeader = standing.position === 1; return ( ); })}
Pos Driver Points Wins Races
{standing.position} {getDriverName(standing.driverId)} {standing.points} {standing.wins} {standing.racesCompleted}
); }