'use client'; import React, {FC, useState} from 'react'; import {InputStyle as S} from './input.style'; import {IInput} from './input.type'; import {RedStarComponent} from '../../atoms/red-star/red-star.component'; import {useTheme} from '@mui/material/styles'; /** * * @author Ali M. Sadeghi * @version 0.0.2 * @description A React component that renders an input field. * @madeUse Emotion */ export const InputComponent: FC = ({ id, label, hint, error, color, disabled, containerClassName, endAdornment, startAdornment, autoComplete, autoFocus, mandatory, ...rest }) => { const [isFocused, setIsFocused] = useState(autoFocus || false); const focusHandler = () => setIsFocused(true); const blurHandler = () => setIsFocused(false); const theme = useTheme(); return ( {mandatory && } {label && ( {label} )} {startAdornment && ( {startAdornment} )} {endAdornment && ( {endAdornment} )} {hint && ( {hint} )} ); };