import React, { useEffect, useRef } from 'react'; export default function TextInput({ type = 'text', name, value, className, autoComplete, required, isFocused, handleChange, isError, readOnly = false, placeholder = '', onKeyDown = () => {}, }) { const input = useRef(); useEffect(() => { if (isFocused) { input.current.focus(); } }, []); if (type === "textarea") { return ( ) } return (