From 3e8e50f1aa593590cbcf288c09b311039949abcf Mon Sep 17 00:00:00 2001 From: Owaise Imdad Date: Fri, 14 Mar 2025 15:32:39 +0530 Subject: [PATCH] FIX-1848 pagination changes. --- src/Components/Table/TablePagination/index.jsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Components/Table/TablePagination/index.jsx b/src/Components/Table/TablePagination/index.jsx index 8427f4270..44b127d45 100644 --- a/src/Components/Table/TablePagination/index.jsx +++ b/src/Components/Table/TablePagination/index.jsx @@ -15,6 +15,14 @@ Pagination.propTypes = { const ROWS_PER_PAGE_OPTIONS = [5, 10, 15, 25]; +// Determine whether pagination buttons should be shown +const shouldShowPaginationButtons = (itemCount, rowsPerPage) => { + return Math.ceil(itemCount / rowsPerPage) > 1; +}; + +// Empty action component for pagination (no-op component) +const EmptyPaginationActions = () =>
; + /** * Pagination component for table navigation with customized styling and behavior. * @@ -41,6 +49,8 @@ function Pagination({ const end = Math.min(page * rowsPerPage + rowsPerPage, itemCount); const range = `${start} - ${end}`; + const showPaginationButtons = shouldShowPaginationButtons(itemCount, rowsPerPage); + return ( `Page ${page + 1} of ${Math.max(0, Math.ceil(count / rowsPerPage))}`