diff --git a/components/chat/ChatConversation.tsx b/components/chat/ChatConversation.tsx index 92fd902ab..5a6461e5b 100644 --- a/components/chat/ChatConversation.tsx +++ b/components/chat/ChatConversation.tsx @@ -1,8 +1,10 @@ import { Schema } from "@/amplify/data/resource"; import { useAIConversation, useGeneralChat } from "@/api/useGeneralChat"; +import { cn } from "@/lib/utils"; import { SendMessage } from "@aws-amplify/ui-react-ai"; import { find, flow, get, identity, last } from "lodash/fp"; import { FC, useEffect, useState } from "react"; +import { useSidebar } from "../ui/sidebar"; import ConversationName from "./ConversationName"; import Errors from "./Errors"; import MessageInput from "./MessageInput"; @@ -25,6 +27,7 @@ const ChatConversation: FC = ({ chatId }) => { ] = useAIConversation("generalChat", { id: chatId }); const { conversations, setConversationName } = useGeneralChat(); const [conversation, setConversation] = useState(); + const { open } = useSidebar(); const getInputFieldKey = () => `${get("id")(conversation) ?? "NA"}-${flow(identity, last, get("id"))(messages)}`; @@ -49,7 +52,11 @@ const ChatConversation: FC = ({ chatId }) => {
diff --git a/components/chat/Message.tsx b/components/chat/Message.tsx index e0b8e5d2e..c405e21c3 100644 --- a/components/chat/Message.tsx +++ b/components/chat/Message.tsx @@ -10,7 +10,7 @@ interface MessageProps { } const Message: FC = ({ message, user }) => ( -
+
= ({ message, user }) => ( /> {message.content.map((content, index) => ( - + ( +
+          ),
+        }}
+      >
         {content.text}
       
     ))}
diff --git a/components/chat/MessageInput.tsx b/components/chat/MessageInput.tsx
index f284f957e..fc62ecba6 100644
--- a/components/chat/MessageInput.tsx
+++ b/components/chat/MessageInput.tsx
@@ -60,7 +60,7 @@ const MessageInput: FC = ({ id, onSend, className }) => {
 
   return (
     
-
+
= ({ children }) => {
-
+
-
-
- -
-
{children}
-
+ {children}
diff --git a/components/layouts/misc/ConversationsPageContent.tsx b/components/layouts/misc/ConversationsPageContent.tsx new file mode 100644 index 000000000..f45140791 --- /dev/null +++ b/components/layouts/misc/ConversationsPageContent.tsx @@ -0,0 +1,30 @@ +import { SidebarTrigger, useSidebar } from "@/components/ui/sidebar"; +import { cn } from "@/lib/utils"; +import { FC, ReactNode } from "react"; + +interface ConversationsPageContentProps { + children?: ReactNode; +} + +const ConversationsPageContent: FC = ({ + children, +}) => { + const { isMobile, open } = useSidebar(); + + return ( +
+
+
+ +
+
{children}
+
+
+ ); +}; +export default ConversationsPageContent;