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