From ae72ca8609fa1349f85739885fc3c560fa8163ec Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 30 Aug 2025 19:48:39 +0000 Subject: [PATCH] Add pagination and sorting to video listings Implements client-side pagination for video content, allowing users to navigate through video lists with "Previous" and "Next" buttons and a page number indicator. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 074b0e4c-6171-43bd-aa98-f9e04623ca14 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/074b0e4c-6171-43bd-aa98-f9e04623ca14/Sy6XHzr --- client/src/pages/FolxStadlPage.tsx | 57 +++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/client/src/pages/FolxStadlPage.tsx b/client/src/pages/FolxStadlPage.tsx index ea85e65..49d9b34 100644 --- a/client/src/pages/FolxStadlPage.tsx +++ b/client/src/pages/FolxStadlPage.tsx @@ -71,7 +71,7 @@ export default function FolxStadlPage() { {/* Video List with Descriptions */}
- {folxStadlVideos.map((video, index) => ( + {currentVideos.map((video, index) => (
{/* Video Card */} @@ -106,6 +106,61 @@ export default function FolxStadlPage() { )}
+ {/* Bottom Pagination */} + {totalPages > 1 && ( +
+ + +
+ {Array.from({ length: Math.min(totalPages, 5) }, (_, i) => { + let pageNum; + if (totalPages <= 5) { + pageNum = i + 1; + } else if (currentPage <= 3) { + pageNum = i + 1; + } else if (currentPage >= totalPages - 2) { + pageNum = totalPages - 4 + i; + } else { + pageNum = currentPage - 2 + i; + } + + return ( + + ); + })} +
+ + +
+ )} +
{/* Video Modal */}