import { createStyles, PasswordInput, TextInput } from '@mantine/core'; import React from 'react'; import { IInput } from '../../../../typings/dialog'; import { UseFormRegisterReturn } from 'react-hook-form'; import LibIcon from '../../../../components/LibIcon'; interface Props { register: UseFormRegisterReturn; row: IInput; index: number; } const useStyles = createStyles((theme) => ({ eyeIcon: { color: theme.colors.dark[2], }, })); const InputField: React.FC = (props) => { const { classes } = useStyles(); return ( <> {!props.row.password ? ( } placeholder={props.row.placeholder} minLength={props.row.min} maxLength={props.row.max} disabled={props.row.disabled} withAsterisk={props.row.required} /> ) : ( } placeholder={props.row.placeholder} minLength={props.row.min} maxLength={props.row.max} disabled={props.row.disabled} withAsterisk={props.row.required} visibilityToggleIcon={({ reveal, size }) => ( )} /> )} ); }; export default InputField;