import { ChevronLeft, ChevronRight } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import { cn } from '@/lib/utils'; type PaginationControlsProps = { page: number; pageSize: number; totalCount: number; onPageChange: (page: number) => void; onPageSizeChange?: (pageSize: number) => void; pageSizeOptions?: number[]; showPageSize?: boolean; className?: string; }; export function PaginationControls({ page, pageSize, totalCount, onPageChange, onPageSizeChange, pageSizeOptions = [10, 25, 50], showPageSize = true, className, }: PaginationControlsProps) { const totalPages = Math.max(1, Math.ceil(totalCount / pageSize)); const safePage = Math.min(Math.max(page, 1), totalPages); const start = totalCount === 0 ? 0 : (safePage - 1) * pageSize + 1; const end = totalCount === 0 ? 0 : Math.min(safePage * pageSize, totalCount); return (