diff --git a/src/renderer/src/pages/catalogue/pagination.tsx b/src/renderer/src/pages/catalogue/pagination.tsx index c2e510b2..377cbad9 100644 --- a/src/renderer/src/pages/catalogue/pagination.tsx +++ b/src/renderer/src/pages/catalogue/pagination.tsx @@ -1,5 +1,6 @@ import { Button } from "@renderer/components/button/button"; import { ChevronLeftIcon, ChevronRightIcon } from "@primer/octicons-react"; +import { useFormat } from "@renderer/hooks/use-format"; interface PaginationProps { page: number; @@ -27,6 +28,8 @@ export function Pagination({ startPage = Math.max(1, endPage - visiblePages + 1); } + const { formatNumber } = useFormat(); + return (
{page > 2 && ( -
- ... -
+ <> + {/* initial page */} + + + {/* ellipsis */} +
+ ... +
+ )} {/* Page Buttons */} @@ -68,21 +84,34 @@ export function Pagination({ style={{ width: 40, maxWidth: 40, maxHeight: 40 }} onClick={() => onPageChange(pageNumber)} > - {pageNumber} + {formatNumber(pageNumber)} ))} {page < totalPages - 1 && ( -
- ... -
+ <> + {/* ellipsis */} +
+ ... +
+ + {/* last page */} + + )} {/* Next Button */}