import { ChevronLeft, ChevronRight } from 'lucide-react'; export default function Pagination({ currentPage, totalPages, basePath, onPageChange }) { if (totalPages <= 1) return null; const getPages = () => { const pages = []; const maxVisible = 5; let start = Math.max(1, currentPage - Math.floor(maxVisible / 2)); let end = Math.min(totalPages, start + maxVisible - 1); if (end - start < maxVisible - 1) start = Math.max(1, end - maxVisible + 1); for (let i = start; i <= end; i++) pages.push(i); return pages; }; const buildUrl = (page) => { const sep = basePath.includes('?') ? '&' : '?'; return `${basePath}${sep}page=${page}`; }; const handlePageClick = (e, page) => { if (onPageChange) { e.preventDefault(); onPageChange(page); } }; return (