import { FormControl, FormHelperText } from '@mui/material' import CheckboxMaterial from '@mui/material/Checkbox' import FormControlLabel from '@mui/material/FormControlLabel' import FormGroup from '@mui/material/FormGroup' import { useTheme } from '@mui/styles' import { FieldInputProps } from 'formik' import React from 'react' export interface ICheckboxField { label: string | number | JSX.Element; field?: FieldInputProps; } interface IOtherProps { [key: string]: any; } export const Checkbox = ({ label, field, selectOptions, theme, setFieldValue, disableDropdown, setPhoneValidationIsLoading, defaultCountry, required, uniqueId, dateFormat, datePlaceholder, isCountryCodeEditable, ...rest }: ICheckboxField & IOtherProps) => { const customTheme: any = useTheme() return ( } label={label} componentsProps={{ typography: customTheme?.checkbox, }} /> {rest?.form?.errors && rest.form.errors[field?.name ?? ''] ? ( Required ) : null} ) }