import "./textField.css"; import React, { useState } from "react"; import { InputAdornment, TextField } from "@mui/material"; import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline"; import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; import { useTheme } from "@mui/material"; /** * @param {Object} props - The component props. * @param {function} props.onChange - The function to call when the text field changes. * @param {string} props.id - The ID of the text field. * @param {string} props.label - The label text for the text field. * @param {string} props.value - The value of the text field. * @param {string} props.variant - The variant of the text field. * @param {string} props.placeholder - The placeholder text for the text field. * @param {ReactNode} props.icon - The icon to display in the text field. * @param {string} props.helperText - The helper text for the text field. * @param {boolean} props.error - Whether the text field has an error. * @returns {JSX.Element} The rendered component. */ const StringTextField = ({ onChange, autoComplete, id, label, value = undefined, variant, placeholder, icon, helperText, error, }) => { const theme = useTheme(); const fontLookup = { default: theme.font.default.font, }; const fontFamily = fontLookup["default"]; const [showIcon, setShowIcon] = useState(false); const handleMouseEnter = () => setShowIcon(true); const handleMouseLeave = () => setShowIcon(false); return (