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

26 lines
755 B
TypeScript

import { notFound } from 'next/navigation';
import { LeagueProtestDetailPageQuery } from '@/lib/page-queries/LeagueProtestDetailPageQuery';
import { ProtestDetailPageClient } from './ProtestDetailPageClient';
interface Props {
params: Promise<{ id: string; protestId: string }>;
}
export default async function Page({ params }: Props) {
const { id, protestId } = await params;
// Execute the PageQuery
const result = await LeagueProtestDetailPageQuery.execute({ leagueId: id, protestId });
if (result.isErr()) {
const error = result.getError();
if (error === 'notFound') {
notFound();
}
}
const viewData = result.isOk() ? result.unwrap() : null;
return <ProtestDetailPageClient initialViewData={viewData} />;
}