From 117fcca328a54ac3d29a3451c18310edb9fd3f3c Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 7 Dec 2022 14:32:14 -0300 Subject: [PATCH] fix pagination number --- packages/fuselage/src/components/Pagination/Pagination.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/fuselage/src/components/Pagination/Pagination.tsx b/packages/fuselage/src/components/Pagination/Pagination.tsx index 807a1b4dcb..1f32127f5d 100644 --- a/packages/fuselage/src/components/Pagination/Pagination.tsx +++ b/packages/fuselage/src/components/Pagination/Pagination.tsx @@ -41,6 +41,7 @@ const defaultShowingResultsLabel = ({ count )} of ${count}`; +const itemsPerPageOptions = [25, 50, 100] as ItemsPerPage[]; export const Pagination = ({ count, current = 0, @@ -52,9 +53,6 @@ export const Pagination = ({ divider, ...props }: PaginationProps) => { - const itemsPerPageOptions = ([25, 50, 100] as ItemsPerPage[]).filter( - (i) => i <= count - ); const hasItemsPerPageSelection = itemsPerPageOptions.length > 1; const currentPage = Math.floor(current / itemsPerPage); const pages = Math.ceil(count / itemsPerPage);