import { useField } from '../../Form/hooks/useField' import { IFieldProps } from '../../Form/types' import './RadioInput.scss' import '../Fields.scss' import classNames from 'classnames' export const RadioInput = ({ fieldConstructor, anyTouched }: IFieldProps) => { const { placeholder, slug, value, setValue, options, errors, touched, setTouched, width, } = useField(fieldConstructor) const showError = errors && errors.length > 0 && (anyTouched || touched) return (
{options?.map((option: string, index) => ( ))}
{showError &&
{errors[0]}
}
) }