hide pagination if only one page

This commit is contained in:
mantikoros 2022-08-02 15:12:03 -07:00
parent 96c0876053
commit 5e8b9711dc

View File

@ -1,4 +1,5 @@
import clsx from 'clsx' import clsx from 'clsx'
import { Spacer } from './layout/spacer'
export function Pagination(props: { export function Pagination(props: {
page: number page: number
@ -23,6 +24,8 @@ export function Pagination(props: {
const maxPage = Math.ceil(totalItems / itemsPerPage) - 1 const maxPage = Math.ceil(totalItems / itemsPerPage) - 1
if (maxPage === 0) return <Spacer h={4} />
return ( return (
<nav <nav
className={clsx( className={clsx(