import Link from "next/link"; import { Button } from "@/components/ui/button"; import { ChevronLeft, ChevronRight } from "lucide-react"; interface PageNavProps { basePath: string; page: number; pageSize: number; total: number; } export function PageNav({ basePath, page, pageSize, total }: PageNavProps) { const totalPages = Math.max(1, Math.ceil(total / pageSize)); if (totalPages <= 1) return null; const from = total === 0 ? 0 : (page - 1) * pageSize + 1; const to = Math.min(page * pageSize, total); return (
{from}-{to} of {total}
{page > 1 ? ( ) : ( )} {page} / {totalPages} {page < totalPages ? ( ) : ( )}
); }