'use client';
import { LeaderboardTableShell } from '@/ui/LeaderboardTableShell';
import { LeaderboardList } from '@/ui/LeaderboardList';
import { RankingRow } from '@/components/leaderboards/RankingRow';
import { useRouter } from 'next/navigation';
import { routes } from '@/lib/routing/RouteConfig';
import { Box } from '@/ui/Box';
import { Text } from '@/ui/Text';
interface StandingEntry {
position: number;
driverName: string;
driverId?: string; // Added to support navigation
teamName?: string;
points: number;
wins: number;
podiums: number;
races: number;
avgFinish: number | null;
gap: string;
}
interface LeagueStandingsTableProps {
standings: StandingEntry[];
}
export function LeagueStandingsTable({ standings }: LeagueStandingsTableProps) {
const router = useRouter();
if (!standings || standings.length === 0) {
return (
No standings data available for this season.
);
}
return (
{standings.map((entry) => (
router.push(routes.driver.detail(entry.driverId!)) : undefined}
/>
))}
);
}