import React, { FC, useState } from "react"; import { ErrorMessage, useField, Field } from "formik"; import { FormGroup } from "reactstrap"; // import PropTypes from "prop-types"; import { Eye, EyeOff } from "react-feather"; import "./index.css"; interface PasswordFieldProps { name: string; label?: string; } const PasswordField: FC = ({ name, label, ...props }) => { const [field, meta] = useField({ name, ...props }); const [showPassword, setShowPassword] = useState(false); const EyeIcon = showPassword ? Eye : EyeOff; const toggleShow = () => { setShowPassword((prev) => !prev); }; return ( <> {label && }
); }; // PasswordField.propTypes = { // name: PropTypes.string.isRequired, // }; export { PasswordField };