import { PageWrapper } from '@/components/shared/state/PageWrapper'; import { PageDataFetcher } from '@/lib/page/PageDataFetcher'; import { TEAM_SERVICE_TOKEN } from '@/lib/di/tokens'; import { TeamService } from '@/lib/services/teams/TeamService'; import { Trophy } from 'lucide-react'; import { redirect } from 'next/navigation'; import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel'; import { TeamLeaderboardPageWrapper } from './TeamLeaderboardPageWrapper'; // ============================================================================ // MAIN PAGE COMPONENT // ============================================================================ export default async function TeamLeaderboardPage() { // Fetch data using PageDataFetcher const teamsData = await PageDataFetcher.fetch( TEAM_SERVICE_TOKEN, 'getAllTeams' ); // Prepare data for template const data: TeamSummaryViewModel[] | null = teamsData; const hasData = (teamsData?.length ?? 0) > 0; // Handle loading state (should be fast since we're using async/await) const isLoading = false; const error = null; const retry = async () => { // In server components, we can't retry without a reload redirect('/teams/leaderboard'); }; return ( ); }