fix e2e
This commit is contained in:
27
apps/website/app/teams/leaderboard/TeamLeaderboardStatic.tsx
Normal file
27
apps/website/app/teams/leaderboard/TeamLeaderboardStatic.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { ServiceFactory } from '@/lib/services/ServiceFactory';
|
||||
import { getWebsiteApiBaseUrl } from '@/lib/config/apiBaseUrl';
|
||||
import TeamLeaderboardInteractive from './TeamLeaderboardInteractive';
|
||||
import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel';
|
||||
|
||||
// ============================================================================
|
||||
// SERVER COMPONENT - Fetches data and passes to Interactive wrapper
|
||||
// ============================================================================
|
||||
|
||||
export default async function TeamLeaderboardStatic() {
|
||||
// Create services for server-side data fetching
|
||||
const serviceFactory = new ServiceFactory(getWebsiteApiBaseUrl());
|
||||
const teamService = serviceFactory.createTeamService();
|
||||
|
||||
// Fetch data server-side
|
||||
let teams: TeamSummaryViewModel[] = [];
|
||||
|
||||
try {
|
||||
teams = await teamService.getAllTeams();
|
||||
} catch (error) {
|
||||
console.error('Failed to load team leaderboard:', error);
|
||||
teams = [];
|
||||
}
|
||||
|
||||
// Pass data to Interactive wrapper which handles client-side interactions
|
||||
return <TeamLeaderboardInteractive teams={teams} />;
|
||||
}
|
||||
Reference in New Issue
Block a user