diff --git a/src/components/ui/labeledCheckbox.tsx b/src/components/ui/labeledCheckbox.tsx new file mode 100644 index 0000000..c4b87f1 --- /dev/null +++ b/src/components/ui/labeledCheckbox.tsx @@ -0,0 +1,50 @@ +import * as React from "react"; +import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; +import { Check } from "lucide-react"; +import { cn } from "@/lib/utils"; + +// You may need to import or define the Checkbox component if it’s in another file, or use it directly if it’s in the same file +// For example, if Checkbox is in the same file and defined like this: +const Checkbox = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + + + +)); +Checkbox.displayName = 'Checkbox'; + +interface LabeledCheckboxProps { + label: string; + name: string; + checked: boolean; + onCheckedChange: (checked: boolean) => void; // Ensure this is expecting a boolean + } + + const LabeledCheckbox = React.forwardRef( + ({ label, name, checked, onCheckedChange }, ref) => ( + + ) + ); + +LabeledCheckbox.displayName = 'LabeledCheckbox'; + +export { LabeledCheckbox };