From 9654628c9cf980fe32c095ccaf9ff681df8e6d9f Mon Sep 17 00:00:00 2001 From: Stephanya Casanova Date: Tue, 25 Jun 2024 14:44:50 +0200 Subject: [PATCH] [frontend] Fix options for tone in message --- .../components/common/form/TextFieldAskAI.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/openbas-front/src/admin/components/common/form/TextFieldAskAI.tsx b/openbas-front/src/admin/components/common/form/TextFieldAskAI.tsx index dd3c1f1a93..00238623f1 100644 --- a/openbas-front/src/admin/components/common/form/TextFieldAskAI.tsx +++ b/openbas-front/src/admin/components/common/form/TextFieldAskAI.tsx @@ -43,7 +43,6 @@ const TextFieldAskAI: FunctionComponent = ({ const [openToneOptions, setOpenToneOptions] = useState(false); const [openGenMessageOptions, setOpenGenMessageOptions] = useState(false); const [openGenMediaOptions, setOpenGenMediaOptions] = useState(false); - const [tone, setTone] = useState<'tactical' | 'operational' | 'strategic'>('tactical'); const [messageContext, setMessageContext] = useState(context ?? ''); const [messageInput, setMessageInput] = useState(currentValue); const [messageParagraphs, setMessageParagraphs] = useState(5); @@ -84,7 +83,7 @@ const TextFieldAskAI: FunctionComponent = ({ const askFixSpelling = async () => aiFixSpelling(currentValue, format, (data: string) => setContent(data)); const askMakeShorter = async () => aiMakeShorter(currentValue, format, (data: string) => setContent(data)); const askMakeLonger = async () => aiMakeLonger(currentValue, format, (data: string) => setContent(data)); - const askChangeTone = async () => aiChangeTone(currentValue, tone, format, (data: string) => setContent(data)); + const askChangeTone = async () => aiChangeTone(currentValue, messageTone, format, (data: string) => setContent(data)); const askSummarize = async () => aiSummarize(currentValue, format, (data: string) => setContent(data)); const askExplain = async () => aiExplain(currentValue, (data: string) => setContent(data)); const askGenMessage = async () => aiGenMessage( @@ -398,13 +397,19 @@ const TextFieldAskAI: FunctionComponent = ({ {t('Tone')}