import React from 'react';
import {FieldProps} from 'formik';
interface CheckboxProps {
label?: string;
disabled?: boolean;
customClasses?: string;
labelId?: string;
}
const Checkbox: React.FC<CheckboxProps & FieldProps> = (props) => {
const {field, label, labelId, disabled, customClasses} = props;
return (
<div className={`custom-checkbox ${customClasses ? customClasses : ''}`}>
<input { ...field } type="checkbox" id={labelId || field.name+label} disabled={disabled}/>
<label htmlFor={labelId || field.name+label}>
{label && <span>{ label }</span>}
</label>
</div>
)
}
export default Checkbox;