Files
gridpilot.gg/apps/website/app/dashboard/page.tsx
2026-01-12 01:01:49 +01:00

26 lines
845 B
TypeScript

import { notFound, redirect } from 'next/navigation';
import { DashboardPageQuery } from '@/lib/page-queries/page-queries/DashboardPageQuery';
import { DashboardPageClient } from './DashboardPageClient';
export default async function DashboardPage() {
const result = await DashboardPageQuery.execute();
// Handle result based on status
switch (result.status) {
case 'ok':
// Pass Page DTO to client component
return <DashboardPageClient pageDto={result.dto} />;
case 'notFound':
notFound();
case 'redirect':
redirect(result.to);
case 'error':
// For now, treat as notFound. Could also show error page
console.error('Dashboard error:', result.errorId);
notFound();
}
}