website refactor
This commit is contained in:
@@ -5,6 +5,8 @@ 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;
|
||||
@@ -26,6 +28,14 @@ interface LeagueStandingsTableProps {
|
||||
export function LeagueStandingsTable({ standings }: LeagueStandingsTableProps) {
|
||||
const router = useRouter();
|
||||
|
||||
if (!standings || standings.length === 0) {
|
||||
return (
|
||||
<Box p={12} textAlign="center" border borderColor="zinc-800" bg="zinc-900/30">
|
||||
<Text color="text-zinc-500" italic>No standings data available for this season.</Text>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<LeaderboardTableShell>
|
||||
<LeaderboardList>
|
||||
|
||||
@@ -40,10 +40,10 @@ export class LeagueStandingsViewDataBuilder {
|
||||
// Extract unique drivers from standings
|
||||
const driverMap = new Map<string, DriverData>();
|
||||
standings.forEach(standing => {
|
||||
if (standing.driver && !driverMap.has(standing.driver.id)) {
|
||||
if (standing.driver && !driverMap.has(standing.driverId)) {
|
||||
const driver = standing.driver;
|
||||
driverMap.set(driver.id, {
|
||||
id: driver.id,
|
||||
driverMap.set(standing.driverId, {
|
||||
id: standing.driverId,
|
||||
name: driver.name,
|
||||
avatarUrl: null, // DTO may not have this
|
||||
iracingId: driver.iracingId,
|
||||
|
||||
Reference in New Issue
Block a user