"use client" import * as React from "react" import * as CheckboxPrimitive from "@radix-ui/react-checkbox" import { CheckIcon } from "lucide-react" import { cn } from "@/lib/utils" const Checkbox = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { indeterminate?: boolean } >(({ className, indeterminate, ...props }, ref) => { const checkboxRef = React.useRef>(null) React.useImperativeHandle(ref, () => checkboxRef.current!) React.useEffect(() => { if (checkboxRef.current) { // The indeterminate property is handled by the Radix checkbox primitive // No need to set it manually on the DOM element } }, [indeterminate]) return ( ) }) Checkbox.displayName = "Checkbox" export { Checkbox }