refactor: update article deletion and retrieval methods to use external ID
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { ArticleList } from '@/ui/components/internal/article/article-list';
|
||||
import { ArticleListSkeleton } from '@/ui/components/internal/article/article-list-skeleton';
|
||||
import { Suspense } from 'react';
|
||||
|
||||
const PAGE_SIZE = 4;
|
||||
const DEFAULT_PAGE_SIZE = 4;
|
||||
|
||||
type HomeProps = {
|
||||
searchParams: Promise<{ page?: string; pageSize?: string }>;
|
||||
searchParams?: { page?: string; pageSize?: string };
|
||||
};
|
||||
|
||||
const Home = async ({ searchParams }: HomeProps) => {
|
||||
const page = Number(searchParams?.page) || 0;
|
||||
const pageSize = Number(searchParams?.pageSize) || DEFAULT_PAGE_SIZE;
|
||||
|
||||
return (
|
||||
<div className='container mx-auto w-full flex-1 px-4 py-12 md:py-16'>
|
||||
<div className='mb-10 border-b border-border pb-8'>
|
||||
@@ -19,14 +20,7 @@ const Home = async ({ searchParams }: HomeProps) => {
|
||||
Latest Articles
|
||||
</h1>
|
||||
</div>
|
||||
<Suspense
|
||||
fallback={<ArticleListSkeleton skeletonSize={PAGE_SIZE} />}
|
||||
>
|
||||
<ArticleList
|
||||
searchParams={searchParams}
|
||||
defaultPageSize={PAGE_SIZE}
|
||||
/>
|
||||
</Suspense>
|
||||
<ArticleList page={page} pageSize={pageSize} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user