From 8357768e4dc3c0c9e63b5ed41567c76b0b7d0426 Mon Sep 17 00:00:00 2001 From: headlesdev Date: Mon, 19 May 2025 00:35:23 +0200 Subject: [PATCH] Sites No Data & Pagination fix --- app/dashboard/sites/SitesPage.tsx | 39 +++++++++++++++++++------------ components/Pagination.tsx | 8 +++++-- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/app/dashboard/sites/SitesPage.tsx b/app/dashboard/sites/SitesPage.tsx index b071bce..41be392 100644 --- a/app/dashboard/sites/SitesPage.tsx +++ b/app/dashboard/sites/SitesPage.tsx @@ -56,21 +56,30 @@ export default function SitesPage({ username, name }: SitesPageProps) { setItemPerPage={setItemPerPage} /> -
- {sites.map((site: any) => ( - - ))} -
+ {sites.length > 0 ? ( +
+ {sites.map((site: any) => ( + + ))} +
+ ) : ( +
+
+

No Sites Found

+

No sites match your current search criteria

+
+
+ )} void; }) { - const totalPages = Math.ceil(totalItems / itemsPerPage); + const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage)); + + if (totalItems === 0) { + return null; + } return (
@@ -25,7 +29,7 @@ export default function Pagination({