diff --git a/src/app/(pages)/home/page.tsx b/src/app/(pages)/home/page.tsx index 7e86613..eddb651 100644 --- a/src/app/(pages)/home/page.tsx +++ b/src/app/(pages)/home/page.tsx @@ -5,19 +5,20 @@ import { FileTextIcon } from 'lucide-react'; const PAGE_SIZE = 9; -interface HomeProps { - searchParams: Promise<{ page?: string }>; -} +type HomeProps = { + searchParams: Promise<{ page?: string; pageSize?: string }>; +}; const Home = async ({ searchParams }: HomeProps) => { - const { page: pageParam } = await searchParams; + const { page: pageParam, pageSize: pageSizeParam } = await searchParams; const page = Math.max(1, Number(pageParam) || 1); + const pageSize = Number(pageSizeParam) || PAGE_SIZE; const { data: articles, totalPages, total, - } = await getArticlesPaginated(page, PAGE_SIZE); + } = await getArticlesPaginated(page, pageSize); return (