type Props = { currentPage: number; totalPages: number; basePath: string; }; export default function Pagination( { currentPage, totalPages, basePath }: Props, ) { if (totalPages <= 1) { return
; } const prevPage = currentPage > 1 ? currentPage - 1 : null; const nextPage = currentPage < totalPages ? currentPage + 1 : null; const prevHref = prevPage === 1 ? basePath : `${basePath}${prevPage}/`; const nextHref = `${basePath}${nextPage}/`; return ( ); }