/** * CheckboxField Component * * 체크박스/스위치 필드 (checkbox, switch) */ 'use client'; import { Checkbox } from '@/components/ui/checkbox'; import { Switch } from '@/components/ui/switch'; import { Label } from '@/components/ui/label'; import type { DynamicFieldProps } from '../types'; import { cn } from '@/lib/utils'; export function CheckboxField({ field, value, error, onChange, onBlur, disabled, }: DynamicFieldProps) { const isSwitch = field.field_type === 'switch'; const checked = value === true || value === 'true' || value === 1; const handleChange = (newChecked: boolean) => { onChange(newChecked); onBlur(); }; if (isSwitch) { return (
{field.help_text}
)} {error &&{error}
}{field.help_text}
)} {error &&{error}
}