diff --git a/src/components/Common/TextArea/TextArea.tsx b/src/components/Common/TextArea/TextArea.tsx index 3a2cf230..08aa5f06 100644 --- a/src/components/Common/TextArea/TextArea.tsx +++ b/src/components/Common/TextArea/TextArea.tsx @@ -5,11 +5,17 @@ import { clsx } from 'clsx'; type TextAreaProps = { value: string; - setValue: (value: string) => void; + setValue?: (value: string) => void; font?: string; + isReadonly?: boolean; }; -export const TextArea = ({ value, setValue, font }: TextAreaProps) => { +export const TextArea = ({ + value, + setValue, + font, + isReadonly +}: TextAreaProps) => { const [lineHeight, setLineHeight] = useState(2.2); const [lineCount, setLineCount] = useState(8); const textAreaRef = useRef(null); @@ -35,8 +41,9 @@ export const TextArea = ({ value, setValue, font }: TextAreaProps) => { setLineCount(calculatedLinesCount); } - - setValue(inputValue); + if (setValue) { + setValue(inputValue); + } }; useEffect(() => { @@ -82,7 +89,7 @@ export const TextArea = ({ value, setValue, font }: TextAreaProps) => {