diff --git a/app/components/chatbot/ChatBot.tsx b/app/components/chatbot/ChatBot.tsx index 87de310..f141269 100644 --- a/app/components/chatbot/ChatBot.tsx +++ b/app/components/chatbot/ChatBot.tsx @@ -15,6 +15,7 @@ import { } from "@/components/ui/card"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Input } from "@/components/ui/input"; +import { Components } from "react-markdown"; interface ChatBotProps { toggleChat?: () => void; @@ -47,6 +48,22 @@ export default function Chatbot({ toggleChat }: ChatBotProps) { } }, [messages]); + const MarkdownComponents: Components = { + code: ({ node, inline, className, children, ...props }: CodeProps) => { + return inline ? ( + + {children} + + ) : ( +
+          {children}
+        
+ ); + }, + ul: ({ children }) => , + ol: ({ children }) =>
  • {children}
  • , + }; + return (
    @@ -94,40 +111,11 @@ export default function Chatbot({ toggleChat }: ChatBotProps) { }`} > - {children} - - ) : ( -
    -                                {children}
    -                              
    - ); - }, - ul: ({ children }) => ( -
      {children}
    - ), - ol: ({ children }) => ( -
  • {children}
  • - ), - }} - /> + components={MarkdownComponents} + > + {message.content} +
    ))}