import { cn } from "./cva.js";
import "react";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/Pagination.tsx
const btn = "rounded-md border border-border bg-surface px-2 py-1 text-sm text-fg disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-accent";
function Pagination({ page, pageCount, onPageChange, label = "Pagination", className }) {
	const canPrev = page > 1;
	const canNext = page < pageCount;
	return /* @__PURE__ */ jsxs("nav", {
		"aria-label": label,
		className: cn("flex items-center gap-2", className),
		children: [
			/* @__PURE__ */ jsx("button", {
				type: "button",
				className: btn,
				disabled: !canPrev,
				onClick: () => canPrev && onPageChange(page - 1),
				children: "Previous"
			}),
			/* @__PURE__ */ jsxs("span", {
				"aria-current": "page",
				className: "text-sm text-fg",
				children: [
					page,
					" / ",
					pageCount
				]
			}),
			/* @__PURE__ */ jsx("button", {
				type: "button",
				className: btn,
				disabled: !canNext,
				onClick: () => canNext && onPageChange(page + 1),
				children: "Next"
			})
		]
	});
}
//#endregion
export { Pagination };
