Files
gridpilot.gg/apps/website/app/teams/page.tsx
2026-01-14 10:51:05 +01:00

24 lines
857 B
TypeScript

import { notFound } from 'next/navigation';
import { TeamsPageQuery } from '@/lib/page-queries/page-queries/TeamsPageQuery';
import { TeamsViewDataBuilder } from '@/lib/builders/view-data/TeamsViewDataBuilder';
import { TeamsPageClient } from './TeamsPageClient';
export default async function Page() {
const result = await TeamsPageQuery.execute();
switch (result.status) {
case 'ok':
const viewData = TeamsViewDataBuilder.build(result.dto);
return <TeamsPageClient teams={viewData.teams} />;
case 'notFound':
notFound();
case 'redirect':
// This would typically use redirect() from next/navigation
// but we need to handle it at the page level
return null;
case 'error':
// For now, treat errors as not found
// In production, you might want a proper error page
notFound();
}
}