home page converted back to server-side component

This commit is contained in:
2024-02-09 09:40:43 +01:00
parent 960210cbc3
commit 27b696faab
5 changed files with 70 additions and 117 deletions

View File

@@ -1,11 +1,7 @@
import { FC, Suspense } from 'react';
import { Main } from './ui/Main';
import dynamic from 'next/dynamic'
const HomePage = dynamic(
() => import('./ui/HomePage'),
{ ssr: false }
)
import HomePage from './ui/HomePage';
import { MonthCardSkeleton } from './ui/MonthCardSkeleton';
export interface PageProps {
searchParams?: {
@@ -14,11 +10,20 @@ export interface PageProps {
};
}
const HomePageSkeleton = () =>
<>
<MonthCardSkeleton checked={true} />
<MonthCardSkeleton />
<MonthCardSkeleton />
</>
const Page:FC<PageProps> = async ({ searchParams }) => {
return (
<Main>
<HomePage />
<Suspense fallback={<HomePageSkeleton />}>
<HomePage searchParams={searchParams} />
</Suspense>
</Main>
);
}