added className to markdown renderer
This commit is contained in:
parent
fb23754638
commit
f19b217853
1 changed files with 3 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import CodeComponent from "./code-component";
|
||||||
|
|
||||||
type MarkdownRendererProps = {
|
type MarkdownRendererProps = {
|
||||||
chatMessage: string;
|
chatMessage: string;
|
||||||
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const preprocessChatMessage = (text: string): string => {
|
const preprocessChatMessage = (text: string): string => {
|
||||||
|
|
@ -48,7 +49,7 @@ export const cleanupTableEmptyCells = (text: string): string => {
|
||||||
})
|
})
|
||||||
.join("\n");
|
.join("\n");
|
||||||
};
|
};
|
||||||
export const MarkdownRenderer = ({ chatMessage }: MarkdownRendererProps) => {
|
export const MarkdownRenderer = ({ chatMessage, className }: MarkdownRendererProps) => {
|
||||||
// Process the chat message to handle <think> tags and clean up tables
|
// Process the chat message to handle <think> tags and clean up tables
|
||||||
const processedChatMessage = preprocessChatMessage(chatMessage);
|
const processedChatMessage = preprocessChatMessage(chatMessage);
|
||||||
|
|
||||||
|
|
@ -57,6 +58,7 @@ export const MarkdownRenderer = ({ chatMessage }: MarkdownRendererProps) => {
|
||||||
className={cn(
|
className={cn(
|
||||||
"markdown prose flex w-full max-w-full flex-col items-baseline text-base font-normal word-break-break-word dark:prose-invert",
|
"markdown prose flex w-full max-w-full flex-col items-baseline text-base font-normal word-break-break-word dark:prose-invert",
|
||||||
!chatMessage ? "text-muted-foreground" : "text-primary",
|
!chatMessage ? "text-muted-foreground" : "text-primary",
|
||||||
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Markdown
|
<Markdown
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue