From ce7ec83c9e9a4347741673f5aedb34e27292942e Mon Sep 17 00:00:00 2001 From: Trung-Tin Pham <60747384+AtelyPham@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:47:31 +0700 Subject: [PATCH] feat: handle properly empty title on Pagination --- .../src/components/Pagination/Pagination.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/webb-ui-components/src/components/Pagination/Pagination.tsx b/libs/webb-ui-components/src/components/Pagination/Pagination.tsx index 9ec08e2ce..ca20bbe74 100644 --- a/libs/webb-ui-components/src/components/Pagination/Pagination.tsx +++ b/libs/webb-ui-components/src/components/Pagination/Pagination.tsx @@ -21,7 +21,7 @@ export const Pagination = React.forwardRef( siblingCount, totalItems, totalPages, - title, + title = '', iconSize = 'lg', ...props }, @@ -70,7 +70,7 @@ export const Pagination = React.forwardRef(

{totalItems === 0 ? 'No items' - : `Showing ${showingItemsCount} ${title} out of ${totalItems ?? '-'}`} + : `Showing ${showingItemsCount} ${title ? `${title} ` : ''}out of ${totalItems ?? '-'}`}

{/** Right buttons */}