(props: CheckboxProps & { children?: ReactNode })
| 8 | onValueChange: (tableName: string, value: boolean) => void; |
| 9 | } |
| 10 | const Checkbox = (props: CheckboxProps & { children?: ReactNode }) => { |
| 11 | const { value, label, onValueChange, children } = props; |
| 12 | return ( |
| 13 | <form> |
| 14 | <div className="flex justify-between items-center px-1"> |
| 15 | <CheckboxUI.Root |
| 16 | checked={value} |
| 17 | onCheckedChange={(value: boolean) => onValueChange(label, value)} |
| 18 | className="bg-white w-5 h-5 shrink-0 cursor-pointer rounded-sm flex border border-gray-300 hover:border-black m-auto" |
| 19 | id={label} |
| 20 | > |
| 21 | <CheckboxUI.Indicator className="m-auto text-black"> |
| 22 | <CheckIcon /> |
| 23 | </CheckboxUI.Indicator> |
| 24 | </CheckboxUI.Root> |
| 25 | <label className="Label grow m-auto px-2 py-1 cursor-pointer truncate text-black dark:text-gray-300" htmlFor={label}> |
| 26 | {label} |
| 27 | </label> |
| 28 | {children} |
| 29 | </div> |
| 30 | </form> |
| 31 | ); |
| 32 | }; |
| 33 | |
| 34 | export default Checkbox; |
nothing calls this directly
no outgoing calls
no test coverage detected