diff --git a/projects/app/src/components/common/Textarea/PromptTextarea/index.tsx b/projects/app/src/components/common/Textarea/PromptTextarea/index.tsx index 8a8c61479..063ea87d4 100644 --- a/projects/app/src/components/common/Textarea/PromptTextarea/index.tsx +++ b/projects/app/src/components/common/Textarea/PromptTextarea/index.tsx @@ -1,4 +1,4 @@ -import React, { useMemo, useState } from 'react'; +import React, { useRef } from 'react'; import { Box, @@ -16,11 +16,13 @@ import MyModal from '@/components/MyModal'; type Props = TextareaProps & { title?: string; - showSetModalModeIcon?: boolean; // variables: string[]; }; const PromptTextarea = (props: Props) => { + const ModalTextareaRef = useRef(null); + const TextareaRef = useRef(null); + const { t } = useTranslation(); const { title = t('core.app.edit.Prompt Editor'), value, ...childProps } = props; @@ -28,21 +30,30 @@ const PromptTextarea = (props: Props) => { return ( <> - + {isOpen && ( - + )} @@ -53,23 +64,26 @@ const PromptTextarea = (props: Props) => { export default PromptTextarea; const Editor = React.memo(function Editor({ - showSetModalModeIcon = true, - onSetModalMode, + onOpenModal, + textareaRef, ...props -}: Props & { onSetModalMode?: () => void }) { +}: Props & { + textareaRef: React.RefObject; + onOpenModal?: () => void; +}) { const { t } = useTranslation(); return ( -