"use client"; import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from "lucide-react"; interface PaginationProps { page: number; totalPages: number; total: number; pageSize: number; onChange: (page: number) => void; /** Nom des éléments comptés (« articles », « publicités »…). */ unite?: string; } /** Pagination commune : « 51 à 100 sur 1 234 articles » et quatre boutons. */ export function Pagination({ page, totalPages, total, pageSize, onChange, unite = "lignes" }: PaginationProps) { if (total === 0 || totalPages <= 1) return null; const debut = (page - 1) * pageSize + 1; const fin = Math.min(page * pageSize, total); const aller = (p: number) => onChange(Math.min(Math.max(1, p), totalPages)); const bouton = "rounded-lg border p-1.5 border-[var(--border-strong)] bg-[var(--bg-surface)] text-[var(--text-secondary)] " + "hover:bg-[var(--bg-elevated)] hover:text-[var(--text-primary)] disabled:cursor-not-allowed disabled:opacity-40"; return ( ); }