diff --git a/app/components/Pagination.tsx b/app/components/Pagination.tsx index 79463f0eb..e33c910f9 100644 --- a/app/components/Pagination.tsx +++ b/app/components/Pagination.tsx @@ -9,12 +9,15 @@ export function Pagination({ nextPage, previousPage, setPage, + compact, }: { currentPage: number; pagesCount: number; nextPage: () => void; previousPage: () => void; setPage: (page: number) => void; + /** Renders only the current page number with prev/next arrows */ + compact?: boolean; }) { const pages = getPageNumbers(currentPage, pagesCount); const [jumpToIndex, setJumpToIndex] = React.useState(null); @@ -30,30 +33,36 @@ export function Pagination({ > - {pages.map((page, index) => - page.value === "..." ? ( - setJumpToIndex(index)} - onClose={() => setJumpToIndex(null)} - onJump={(page) => { - setPage(page); - setJumpToIndex(null); - }} - /> - ) : ( - - ), + {compact ? ( + + {currentPage} + + ) : ( + pages.map((page, index) => + page.value === "..." ? ( + setJumpToIndex(index)} + onClose={() => setJumpToIndex(null)} + onJump={(page) => { + setPage(page); + setJumpToIndex(null); + }} + /> + ) : ( + + ), + ) )}