import FormikFieldWrapper from '@/components/elements/FormikFieldWrapper'; import { Field, FieldProps } from 'formik'; import Switch, { SwitchProps } from '@/components/elements/Switch'; const FormikSwitch = ({ name, label, ...props }: SwitchProps) => { return ( {({ field, form }: FieldProps) => ( { form.setFieldTouched(name); form.setFieldValue(field.name, !field.value); }} defaultChecked={field.value} {...props} /> )} ); }; export default FormikSwitch;