Skip to content

Commit 2e677ba

Browse files
committed
fix: prevent rendering of pagination controls for invalid states
1 parent 6332132 commit 2e677ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/PaginatedNavigation.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export const PaginatedNavigation = ({
1919
totalPages,
2020
onPageChange,
2121
}: PaginationControlsProps) => {
22+
// Don't render pagination if no pages or invalid state
23+
if (!totalPages || totalPages <= 0 || currentPage <= 0) {
24+
return null;
25+
}
26+
2227
const generatePages = () => {
2328
const pages: (number | 'ellipsis')[] = [];
2429

0 commit comments

Comments
 (0)