From 5e8b9711dc375f9968e59dce2009dfc04133eccc Mon Sep 17 00:00:00 2001 From: mantikoros Date: Tue, 2 Aug 2022 15:12:03 -0700 Subject: [PATCH] hide pagination if only one page --- web/components/pagination.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/components/pagination.tsx b/web/components/pagination.tsx index 3f4108bc..5f3d4da2 100644 --- a/web/components/pagination.tsx +++ b/web/components/pagination.tsx @@ -1,4 +1,5 @@ import clsx from 'clsx' +import { Spacer } from './layout/spacer' export function Pagination(props: { page: number @@ -23,6 +24,8 @@ export function Pagination(props: { const maxPage = Math.ceil(totalItems / itemsPerPage) - 1 + if (maxPage === 0) return + return (