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

26 lines
770 B
TypeScript

import { notFound } from 'next/navigation';
import { LeagueProtestDetailPageQuery } from '@/lib/page-queries/LeagueProtestDetailPageQuery';
import { ProtestDetailPageClient } from '@/client-wrapper/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 viewData={viewData as any} />;
}