QuizFlash / src /components /ui /checkbox-field.tsx
Shih-hungg's picture
Update article generation and use langfuse
34d6b36
raw
history blame contribute delete
737 Bytes
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>
);
}