import Link from "next/link"; export function Pagination({ page, pageSize, total, hrefFor, }: { page: number; pageSize: number; total: number; hrefFor: (p: number) => string; }) { const pages = Math.max(1, Math.ceil(total / pageSize)); if (pages <= 1) return null; const items = Array.from({ length: pages }, (_, i) => i + 1).filter( (p) => p === 1 || p === pages || Math.abs(p - page) <= 2, ); return ( ); }