Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added community-chatbot/app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 30 additions & 5 deletions community-chatbot/components/agent/Mode/Chat/Panel/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,36 @@ export function MessageList({ messages }: MessageListProps) {
: 'bg-white dark:bg-gray-700 shadow-sm border dark:border-gray-600 max-w-[80%]'
}`}
>
<div className="whitespace-pre-wrap">
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{message.content}
</ReactMarkdown>
</div>

<ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
pre: ({ children }) => (
<pre className="whitespace-pre-wrap break-words overflow-hidden">
{children}
</pre>
),
code: ({ inline, children }: any) => (
<code
className={`${inline
? "whitespace-pre-wrap break-words"
: "block whitespace-pre-wrap break-words"
}`}
>
{children}
</code>
),
a: ({ children }) => (
<span className="break-all">{children}</span>
),
table: ({ children }) => (
<div className="overflow-hidden">{children}</div>
),
}}
>
{message.content}
</ReactMarkdown>

</div>
<CopyButton
textToCopy={message.content}
Expand Down
Loading