Browse Source

Define a type

satof3 8 months ago
parent
commit
21a01b1238

+ 5 - 2
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantManagementModal/AiAssistantManagementEditInstruction.tsx

@@ -19,15 +19,18 @@ type Props = {
   instruction: string;
   instruction: string;
   onChange: (value: string) => void;
   onChange: (value: string) => void;
   onReset: () => void;
   onReset: () => void;
+  backToPageMode?: AiAssistantManagementModalPageMode;
 }
 }
 
 
 export const AiAssistantManagementEditInstruction = (props: Props): JSX.Element => {
 export const AiAssistantManagementEditInstruction = (props: Props): JSX.Element => {
-  const { instruction, onChange, onReset } = props;
+  const {
+    instruction, onChange, onReset, backToPageMode = AiAssistantManagementModalPageMode.HOME,
+  } = props;
   const { t } = useTranslation();
   const { t } = useTranslation();
   const { changePageMode } = useAiAssistantManagementModal();
   const { changePageMode } = useAiAssistantManagementModal();
 
 
   const handleComplete = () => {
   const handleComplete = () => {
-    changePageMode(AiAssistantManagementModalPageMode.HOME);
+    changePageMode(backToPageMode);
   };
   };
 
 
   return (
   return (