import { cs } from "../utils/styles.js";
import { useStyleConfig } from "../core/theme.js";
import vui from "../core/vui.js";
import Button from "../button/button.js";
import { usePaginationContext } from "./context.js";
import { jsx } from "react/jsx-runtime";

//#region src/pagination/paginationButton.tsx
/** Displays a page navigation button within the Pagination. */
const PaginationButton = vui((props, ref) => {
	const { className, isActive: isActiveProp, page: pageProp, ...rest } = props;
	const { onPageChange, page } = usePaginationContext();
	const styles = useStyleConfig("Pagination", usePaginationContext());
	const activeProps = isActiveProp ?? pageProp === page ? { bg: "skyBlue.85" } : {};
	return /* @__PURE__ */ jsx(Button, {
		className: cs("vui-paginationButton", className),
		onClick: () => onPageChange(pageProp),
		ref,
		size: "sm",
		text: pageProp,
		variant: "text",
		...styles.button,
		...activeProps,
		...rest
	});
});
PaginationButton.displayName = "PaginationButton";

//#endregion
export { PaginationButton as default };
globalThis.__vuiVersion__ = "4.0.1"
//# sourceMappingURL=paginationButton.js.map