import { useEffect, useRef, useState } from 'react' import { InputLabel } from './InputLabel' interface TextAreaProps { labelTitle?: string containerStyle?: string dataField?: string inputStyle?: string defaultValue: string placeholder?: string required?: boolean updateFormValue?: (value: string) => void } /** * @category Input */ export function TextAreaInput({ labelTitle, dataField, containerStyle, inputStyle, defaultValue, placeholder, required = true, updateFormValue, }: TextAreaProps) { const ref = useRef(null) const [inputValue, setInputValue] = useState(defaultValue) useEffect(() => { setInputValue(defaultValue) }, [defaultValue]) const handleChange = (e: React.ChangeEvent) => { const newValue = e.target.value setInputValue(newValue) if (updateFormValue) { updateFormValue(newValue) } } return (
{labelTitle ? : null}
) }