import { LeagueSchedulePageQuery } from '@/lib/page-queries/page-queries/LeagueSchedulePageQuery';
import { LeagueScheduleTemplate } from '@/templates/LeagueScheduleTemplate';
import { notFound } from 'next/navigation';
interface Props {
params: { id: string };
}
export default async function LeagueSchedulePage({ params }: Props) {
const leagueId = params.id;
if (!leagueId) {
notFound();
}
const result = await LeagueSchedulePageQuery.execute(leagueId);
if (result.isErr()) {
const error = result.getError();
if (error.type === 'notFound') {
notFound();
}
// For serverError, show the template with empty data
return ;
}
return ;
}