"use client";
import * as React from "react";
import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
import { cn } from "../lib/utils";
import { Button } from "./button";
/** Page through results; shows the visible range and previous/next. */
export function Pagination({
page,
pageSize,
total,
onPageChange,
hasNext = false,
className,
}: {
/** Zero-based page index. */
page: number;
pageSize: number;
/** Total rows when known; null for cursor-based paging. */
total: number | null;
onPageChange: (page: number) => void;
/** For cursor paging: whether another page exists. */
hasNext?: boolean;
className?: string;
}) {
const from = page * pageSize + 1;
const to = total === null ? (page + 1) * pageSize : Math.min(total, (page + 1) * pageSize);
const last = total === null ? !hasNext : to >= total;
return (
);
}
/** Where you are: a trail of links ending in the current page. */
export function Breadcrumbs({
items,
className,
}: {
items: Array<{ label: React.ReactNode; onSelect?: () => void }>;
className?: string;
}) {
return (
);
}