diff --git a/apps/app/components/core/modals/gpt-assistant-modal.tsx b/apps/app/components/core/modals/gpt-assistant-modal.tsx index 1d3af7a51..0c5e0eded 100644 --- a/apps/app/components/core/modals/gpt-assistant-modal.tsx +++ b/apps/app/components/core/modals/gpt-assistant-modal.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState, forwardRef, useRef } from "react"; +import React, { useEffect, useState, forwardRef, useRef } from "react"; import { useRouter } from "next/router"; import dynamic from "next/dynamic"; @@ -15,6 +15,7 @@ import useUserAuth from "hooks/use-user-auth"; import { Input, PrimaryButton, SecondaryButton } from "components/ui"; import { IIssue, IPageBlock } from "types"; +import Tiptap, { ITiptapRichTextEditor } from "components/tiptap"; type Props = { isOpen: boolean; handleClose: () => void; @@ -44,6 +45,14 @@ type FormData = { // // WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; +const TiptapEditor = React.forwardRef< + ITiptapRichTextEditor, + ITiptapRichTextEditor +>((props, ref) => ); + +TiptapEditor.displayName = "TiptapEditor"; + + export const GptAssistantModal: React.FC = ({ isOpen, handleClose, @@ -146,33 +155,48 @@ export const GptAssistantModal: React.FC = ({ return (
- {/* {((content && content !== "") || (htmlContent && htmlContent !== "

")) && ( */} - {/*
*/} - {/* Content: */} - {/* {content}

} */} - {/* customClassName="-m-3" */} - {/* noBorder */} - {/* borderOnFocus={false} */} - {/* editable={false} */} - {/* ref={editorRef} */} - {/* /> */} - {/*
*/} - {/* )} */} + {((content && content !== "") || (htmlContent && htmlContent !== "

")) && ( +
+ Content: + ${content}

`} + customClassName="-m-3" + noBorder + borderOnFocus={false} + editable={false} + ref={editorRef} + /> + {/* {content}

} */} + {/* customClassName="-m-3" */} + {/* noBorder */} + {/* borderOnFocus={false} */} + {/* editable={false} */} + {/* ref={editorRef} */} + {/* /> */} +
+ )} {response !== "" && (
Response: - ${response}

`} customClassName="-mx-3 -my-3" noBorder borderOnFocus={false} editable={false} /> + + {/* ${response}

`} */} + {/* customClassName="-mx-3 -my-3" */} + {/* noBorder */} + {/* borderOnFocus={false} */} + {/* editable={false} */} + {/* /> */}
)} {invalidResponse && ( @@ -185,11 +209,10 @@ export const GptAssistantModal: React.FC = ({ type="text" name="task" register={register} - placeholder={`${ - content && content !== "" - ? "Tell AI what action to perform on this content..." - : "Ask AI anything..." - }`} + placeholder={`${content && content !== "" + ? "Tell AI what action to perform on this content..." + : "Ask AI anything..." + }`} autoComplete="off" />
@@ -225,8 +248,8 @@ export const GptAssistantModal: React.FC = ({ {isSubmitting ? "Generating response..." : response === "" - ? "Generate response" - : "Generate again"} + ? "Generate response" + : "Generate again"}