| import { Label } from '@/components/ui/label'; | |
| import { CheckboxGrid } from '@/components/ui/checkbox-grid'; | |
| interface CheckboxFieldProps { | |
| label: string; | |
| fieldName: string; | |
| value: string[]; | |
| onChange: (value: string) => void; | |
| options: string[]; | |
| columns?: 1 | 2 | 3 | 4; | |
| className?: string; | |
| } | |
| export function CheckboxField({ | |
| label, | |
| fieldName, | |
| value, | |
| onChange, | |
| options, | |
| columns = 1, | |
| className = '' | |
| }: CheckboxFieldProps) { | |
| return ( | |
| <div className={className}> | |
| <Label className="mb-2">{label}</Label> | |
| <CheckboxGrid | |
| options={options} | |
| selectedValues={value} | |
| onSelectionChange={onChange} | |
| fieldName={fieldName} | |
| columns={columns} | |
| /> | |
| </div> | |
| ); | |
| } | |