import { notFound } from 'next/navigation';
import { PageWrapper } from '@/components/shared/state/PageWrapper';
import { DashboardTemplate } from '@/templates/DashboardTemplate';
import { PageDataFetcher } from '@/lib/page/PageDataFetcher';
import { DASHBOARD_SERVICE_TOKEN } from '@/lib/di/tokens';
import type { DashboardService } from '@/lib/services/dashboard/DashboardService';

export default async function DashboardPage() {
    const data = await PageDataFetcher.fetch<DashboardService, 'getDashboardOverview'>(
        DASHBOARD_SERVICE_TOKEN,
        'getDashboardOverview'
    );
    
    if (!data) notFound();
    
    return <PageWrapper data={data} Template={DashboardTemplate} />;
}