Files
gridpilot.gg/apps/website/app/leagues/[id]/schedule/admin/page.tsx
2026-01-16 01:00:03 +01:00

26 lines
798 B
TypeScript

import { notFound } from 'next/navigation';
import { LeagueScheduleAdminPageQuery } from '@/lib/page-queries/LeagueScheduleAdminPageQuery';
import { LeagueAdminSchedulePageClient } from './LeagueAdminSchedulePageClient';
interface Props {
params: Promise<{ id: string }>;
}
export default async function Page({ params }: Props) {
const { id } = await params;
// Execute the PageQuery
const result = await LeagueScheduleAdminPageQuery.execute({ leagueId: id });
if (result.isErr()) {
const error = result.getError();
if (error === 'notFound') {
notFound();
}
// For other errors, we still render the client component which handles its own loading/error states
// or we could render an error banner here.
}
return <LeagueAdminSchedulePageClient />;
}