website refactor

This commit is contained in:
2026-01-17 02:03:19 +01:00
parent 75ffe0798e
commit 6a49448e0a
18 changed files with 168 additions and 47 deletions

View File

@@ -1,19 +1,17 @@
import { PageWrapper } from '@/components/shared/state/PageWrapper';
import { HomeTemplate, type HomeViewData } from '@/templates/HomeTemplate';
import { PageDataFetcher } from '@/lib/page/PageDataFetcher';
import { HomeService } from '@/lib/services/home/HomeService'; // @server-safe
import { HomePageQuery } from '@/lib/page-queries/HomePageQuery';
import { notFound, redirect } from 'next/navigation';
import { routes } from '@/lib/routing/RouteConfig';
export default async function Page() {
const homeService = new HomeService();
if (await homeService.shouldRedirectToDashboard()) {
if (await HomePageQuery.shouldRedirectToDashboard()) {
redirect(routes.protected.dashboard);
}
const data = await PageDataFetcher.fetchManual(async () => {
const result = await homeService.getHomeData();
const result = await HomePageQuery.execute();
return result.isOk() ? result.unwrap() : null;
});