hide pagination if only one page
This commit is contained in:
parent
96c0876053
commit
5e8b9711dc
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user