import { Checkbox } from "@/components/ui/checkbox"; import { usePage } from "@inertiajs/react"; import { ReactNode } from "react"; import InputError from "$/base/InputError"; import { Label } from "@/components/ui/label"; import { cn } from "@/lib/utils"; type SimpleCheckboxProps = { className?: string; name: string; label: ReactNode | string; value?: boolean; id?: string; disabled?: boolean; parentErrors?: Record | null; // eslint-disable-next-line no-unused-vars setData: (name: string, value: boolean) => void; }; export default function SimpleCheckbox({ className, value = false, name, label, id = name, disabled = false, parentErrors = null, setData, }: SimpleCheckboxProps) { const { errors } = usePage().props; const localErrors = parentErrors ?? errors; return (
{ setData(name, Boolean(v)); }} />
); }