MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / Checkbox

Function Checkbox

src/components/kit/Checkbox.tsx:10–32  ·  view source on GitHub ↗
(props: CheckboxProps & { children?: ReactNode })

Source from the content-addressed store, hash-verified

8 onValueChange: (tableName: string, value: boolean) => void;
9}
10const 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
34export default Checkbox;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected