This commit is contained in:
2026-01-05 19:35:49 +01:00
parent b4b915416b
commit d9e6151ae0
92 changed files with 10964 additions and 7893 deletions

View File

@@ -0,0 +1,32 @@
import { LeaguesTemplate } from '@/templates/LeaguesTemplate';
import { ServiceFactory } from '@/lib/services/ServiceFactory';
import { getWebsiteApiBaseUrl } from '@/lib/config/apiBaseUrl';
import type { LeagueSummaryViewModel } from '@/lib/view-models/LeagueSummaryViewModel';
export default async function LeaguesStatic() {
const serviceFactory = new ServiceFactory(getWebsiteApiBaseUrl());
const leagueService = serviceFactory.createLeagueService();
let leagues: LeagueSummaryViewModel[] = [];
let loading = false;
try {
loading = true;
leagues = await leagueService.getAllLeagues();
} catch (error) {
console.error('Failed to load leagues:', error);
} finally {
loading = false;
}
// Server components can't have event handlers, so we provide empty functions
// The Interactive wrapper will add the actual handlers
return (
<LeaguesTemplate
leagues={leagues}
loading={loading}
onLeagueClick={() => {}}
onCreateLeagueClick={() => {}}
/>
);
}