From c3f8e6c31c635816fc93ed04301cf4efe351b121 Mon Sep 17 00:00:00 2001 From: chaitanyakole Date: Thu, 26 Dec 2024 17:27:25 +0530 Subject: [PATCH] Changes in code --- src/pages/tenant.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/tenant.tsx b/src/pages/tenant.tsx index 89827a3..c4217c5 100644 --- a/src/pages/tenant.tsx +++ b/src/pages/tenant.tsx @@ -379,15 +379,17 @@ const Tenant: React.FC = () => { // setTotalCount(totalCount); // Set the total count setPagination(totalCount >= 10); - setPageSizeArray( - totalCount > 15 - ? [5, 10, 15] - : totalCount >= 10 - ? [5, 10] - : totalCount > 5 - ? [5] - : [] - ); + let pageSizeArrayCount: any = []; + + if (totalCount > 15) { + pageSizeArrayCount = [5, 10, 15]; + } else if (totalCount >= 10) { + pageSizeArrayCount = [5, 10]; + } else if (totalCount > 5) { + pageSizeArrayCount = [5]; + } + + setPageSizeArray(pageSizeArrayCount); const pageCount = Math.ceil(totalCount / pageLimit); setPageCount(pageCount); } else { @@ -1276,8 +1278,6 @@ const Tenant: React.FC = () => { setSelectedBlock: setSelectedBlock, }; - console.log(totalCount >= Numbers.TEN, "totalCount > Numbers.FIVE"); - return ( <>