website refactor

This commit is contained in:
2026-01-12 01:01:49 +01:00
parent 5ca6023a5a
commit fefd8d1cd6
294 changed files with 4628 additions and 4991 deletions

View File

@@ -1,7 +1,6 @@
import { notFound, redirect } from 'next/navigation';
import { DashboardPageQuery } from '@/lib/page-queries/DashboardPageQuery';
import { DashboardPageQuery } from '@/lib/page-queries/page-queries/DashboardPageQuery';
import { DashboardPageClient } from './DashboardPageClient';
import { buildDashboardViewData } from './DashboardViewDataBuilder';
export default async function DashboardPage() {
const result = await DashboardPageQuery.execute();
@@ -9,23 +8,18 @@ export default async function DashboardPage() {
// Handle result based on status
switch (result.status) {
case 'ok':
const viewModelData = result.data;
// Build SSR ViewData directly from ViewModelData
const ssrViewData = buildDashboardViewData(viewModelData);
// Pass both ViewData (for SSR) and ViewModelData (for client enhancement)
return <DashboardPageClient initialViewData={ssrViewData} dto={viewModelData} />;
// Pass Page DTO to client component
return <DashboardPageClient pageDto={result.dto} />;
case 'notFound':
notFound();
case 'redirect':
redirect(result.destination);
redirect(result.to);
case 'error':
// For now, treat as notFound. Could also show error page
console.error('Dashboard error:', result.error);
console.error('Dashboard error:', result.errorId);
notFound();
}
}
}