website refactor
This commit is contained in:
@@ -19,9 +19,9 @@ export default async function DriverLeaderboardPage() {
|
||||
);
|
||||
|
||||
// Prepare data for template
|
||||
const data: DriverLeaderboardViewModel | null = driverData as DriverLeaderboardViewModel | null;
|
||||
const data: DriverLeaderboardViewModel | null = driverData;
|
||||
|
||||
const hasData = (driverData as any)?.drivers?.length > 0;
|
||||
const hasData = (driverData?.drivers?.length ?? 0) > 0;
|
||||
|
||||
// Handle loading state (should be fast since we're using async/await)
|
||||
const isLoading = false;
|
||||
|
||||
@@ -37,11 +37,11 @@ export default async function LeaderboardsPage() {
|
||||
|
||||
// Prepare data for template
|
||||
const data: LeaderboardsPageData = {
|
||||
drivers: driverData as DriverLeaderboardViewModel | null,
|
||||
teams: teamsData as TeamSummaryViewModel[] | null,
|
||||
drivers: driverData,
|
||||
teams: teamsData,
|
||||
};
|
||||
|
||||
const hasData = (driverData as any)?.drivers?.length > 0 || (teamsData as any)?.length > 0;
|
||||
const hasData = (driverData?.drivers?.length ?? 0) > 0 || (teamsData?.length ?? 0) > 0;
|
||||
|
||||
// Handle loading state (should be fast since we're using async/await)
|
||||
const isLoading = false;
|
||||
|
||||
Reference in New Issue
Block a user