import { PageWrapper } from '@/components/shared/state/PageWrapper'; import { TeamService } from '@/lib/services/teams/TeamService'; import { Trophy } from 'lucide-react'; import { redirect } from 'next/navigation'; import { routes } from '@/lib/routing/RouteConfig'; import { TeamLeaderboardPageWrapper } from './TeamLeaderboardPageWrapper'; // ============================================================================ // MAIN PAGE COMPONENT // ============================================================================ export default async function TeamLeaderboardPage() { // Manual wiring: create dependencies const service = new TeamService(); // Fetch data through service const result = await service.getAllTeams(); // Handle result let data = null; let error = null; if (result.isOk()) { data = result.unwrap(); } else { const domainError = result.getError(); error = new Error(domainError.message); } const hasData = (data?.length ?? 0) > 0; // Handle loading state (should be fast since we're using async/await) const isLoading = false; const retry = () => { // In server components, we can't retry without a reload redirect(routes.team.detail('leaderboard')); }; return ( ); }