diff --git a/src/components/reusable/Pagination.tsx b/src/components/reusable/Pagination.tsx index c10580c..3732c73 100644 --- a/src/components/reusable/Pagination.tsx +++ b/src/components/reusable/Pagination.tsx @@ -14,7 +14,6 @@ export interface PaginationProps { /** Pager: "Showing a–b of N" + Prev/Next. Renders nothing when the set fits on * one page. Shared by the record-view tables. */ export function Pagination({ page, pageSize, total, onPage, onPageSizeChange }: PaginationProps) { - if (total <= 0) return null; const totalPages = Math.max(1, Math.ceil(total / pageSize)); const safePage = Math.min(Math.max(page, 1), totalPages); const start = (safePage - 1) * pageSize; @@ -25,6 +24,8 @@ export function Pagination({ page, pageSize, total, onPage, onPageSizeChange }: setJumpPage(safePage.toString()); }, [safePage]); + if (total <= 0) return null; + const handlePageChange = (newPage: number) => { onPage(newPage); window.scrollTo({ top: 0, behavior: 'smooth' });