import { ChevronsLeft, ChevronsRight, ChevronLeft, ChevronRight } from "lucide-react"; import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { cn } from "@/shared/lib/cn"; const PAGE_SIZE_OPTIONS = [20, 100, 500, 1000, 2000] as const; export function Pagination({ page, pageSize, total, onPageChange, onPageSizeChange, className }: { page: number; pageSize: number; total: number; onPageChange: (page: number) => void; onPageSizeChange?: (pageSize: number) => void; className?: string }) { const { t } = useTranslation(); const pages = Math.max(1, Math.ceil(total / pageSize)); return (
{t("common.pageOf", { page, pages })}
{onPageSizeChange ? : }
); } export function CursorPagination({ page, pageSize, hasMore, disabled = false, onFirstPage, onPreviousPage, onNextPage, onPageSizeChange, className }: { page: number; pageSize: number; hasMore: boolean; disabled?: boolean; onFirstPage: () => void; onPreviousPage: () => void; onNextPage: () => void; onPageSizeChange: (pageSize: number) => void; className?: string }) { const { t } = useTranslation(); return (
{t("audits.cursorPage", { page })}
); } function PageSizeSelector({ pageSize, disabled = false, onChange }: { pageSize: number; disabled?: boolean; onChange: (pageSize: number) => void }) { const { t } = useTranslation(); return (
{t("common.perPage")} {t("common.rows")}
); }