import { Box, InputGroup, InputLeftElement, InputRightElement, Text, Input, } from "@chakra-ui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Row } from "../../../interfaces/dialog"; interface Props { row: Row; index: number; handleChange: (value: string | boolean, index: number) => void; passwordStates: boolean[]; handlePasswordStates: (index: number) => void; } const InputField: React.FC = (props) => { return ( <> {props.row.label} {props.row.icon && ( } /> )} props.handleChange(e.target.value, props.index)} type={ !props.row.password || props.passwordStates[props.index] ? "text" : "password" } /> {props.row.password && ( props.handlePasswordStates(props.index)} children={ } /> )} ); }; export default InputField;