feature/adds-admin-add-article #1

Merged
HideyoshiNakazone merged 21 commits from feature/adds-admin-add-article into main 2026-04-11 04:30:42 +00:00
Showing only changes of commit dbb459a3a5 - Show all commits

View File

@@ -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 (
<div className='container mx-auto w-full flex-1 px-4 py-12 md:py-16'>