Files
gridpilot.gg/apps/website/app/page.tsx
2026-01-19 18:01:30 +01:00

23 lines
702 B
TypeScript

import { HomePageClient } from '@/client-wrapper/HomePageClient';
import { PageDataFetcher } from '@/lib/page/PageDataFetcher';
import { HomePageQuery } from '@/lib/page-queries/HomePageQuery';
import { notFound, redirect } from 'next/navigation';
import { routes } from '@/lib/routing/RouteConfig';
export default async function Page() {
if (await HomePageQuery.shouldRedirectToDashboard()) {
redirect(routes.protected.dashboard);
}
const data = await PageDataFetcher.fetchManual(async () => {
const result = await HomePageQuery.execute();
return result.isOk() ? result.unwrap() : null;
});
if (!data) {
notFound();
}
return <HomePageClient viewData={data} />;
}