import { router } from "@inertiajs/react"; import clsx from "clsx"; import type { ButtonHTMLAttributes, ReactNode } from "react"; /** POST an action and refresh only what it can change. */ export function act(url: string, data: Record = {}, only = ["printer", "notice"]) { router.post(url, data as never, { preserveScroll: true, preserveState: true, only }); } type ButtonProps = ButtonHTMLAttributes & { variant?: "primary" | "secondary" | "ghost" | "danger"; size?: "sm" | "md" | "lg"; }; export function Button({ variant = "secondary", size = "md", className, ...props }: ButtonProps) { return (