website refactor

This commit is contained in:
2026-01-21 22:36:01 +01:00
parent ea58909070
commit 5ed958281d
49 changed files with 8763 additions and 131 deletions

View File

@@ -30,21 +30,22 @@ interface StandingEntry {
interface LeagueStandingsTableProps {
standings: StandingEntry[];
'data-testid'?: string;
}
export function LeagueStandingsTable({ standings }: LeagueStandingsTableProps) {
export function LeagueStandingsTable({ standings, 'data-testid': dataTestId }: LeagueStandingsTableProps) {
const router = useRouter();
if (!standings || standings.length === 0) {
return (
<Box p={12} textAlign="center" border borderColor="zinc-800" bg="zinc-900/30">
<Box p={12} textAlign="center" border borderColor="zinc-800" bg="zinc-900/30" data-testid={dataTestId}>
<Text color="text-zinc-500" italic>No standings data available for this season.</Text>
</Box>
);
}
return (
<LeaderboardTableShell>
<LeaderboardTableShell data-testid={dataTestId}>
<LeaderboardList>
{standings.map((entry) => (
<RankingRow
@@ -60,6 +61,8 @@ export function LeagueStandingsTable({ standings }: LeagueStandingsTableProps) {
rating={0}
wins={entry.wins}
onClick={entry.driverId ? () => router.push(routes.driver.detail(entry.driverId!)) : undefined}
data-testid="standings-row"
droppedRaceIds={entry.droppedRaceIds}
/>
))}
</LeaderboardList>