From e868f0a15ab5e265c33b253a7606f304695154b0 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 13 Jul 2022 15:15:03 -0500 Subject: [PATCH] Fix pagination component going one page too far + tweaks --- web/components/pagination.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/web/components/pagination.tsx b/web/components/pagination.tsx index 968e49a8..a585985d 100644 --- a/web/components/pagination.tsx +++ b/web/components/pagination.tsx @@ -7,6 +7,8 @@ export function Pagination(props: { }) { const { page, itemsPerPage, totalItems, setPage, scrollToTop } = props + const maxPage = Math.ceil(totalItems / itemsPerPage) - 1 + return (