import { HStack, Input, Tooltip, Box, Switch, FormControl, FormLabel } from '@chakra-ui/react'; import { TFunction } from 'i18next'; import { Controller } from 'react-hook-form'; interface UsernameFieldProps { form: any; isEditing: boolean; t: TFunction<'translation', undefined, 'translation'>; disabled: boolean; } export const UsernameField = ({ form, isEditing, t, disabled }: UsernameFieldProps) => { return ( {t('username')} {isEditing && ( { return ( { if (e.target.checked) { field.onChange('active'); } else { field.onChange('disabled'); } }} /> ); }} /> )} ) }