import React, { useState } from "react"; import { useRouter } from "next/router"; import { faCircle, faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import guidGenerator from "../utilities/randomId"; interface InputFieldProps { static?: boolean; label: string; type: string; value: string; placeholder?: string; isRequired: boolean; disabled?: boolean; error?: boolean; text?: string; name?: string; blurred?: boolean; errorText?: string; onChangeHandler: (value: string) => void; } const InputField = (props: InputFieldProps) => { const [passwordVisible, setPasswordVisible] = useState(false); const router = useRouter(); if (props.static === true) { return (
{props.label}
{props.text && ({props.text}
)} props.onChangeHandler(e.target.value)} type={props.type} placeholder={props.placeholder} value={props.value} required={props.isRequired} className="bg-bunker-800 text-gray-400 border border-gray-600 rounded-md text-md p-2 w-full min-w-16 outline-none" name={props.name} readOnly />{props.label}
{/* {props.label == "Password" && router.asPath != "/login" && ({props.errorText}
)}