forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatMarkdown.tsx
More file actions
22 lines (19 loc) · 993 Bytes
/
Copy pathChatMarkdown.tsx
File metadata and controls
22 lines (19 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use client';
import { Streamdown } from 'streamdown';
interface ChatMarkdownProps {
children: string;
isStreaming?: boolean;
}
export function ChatMarkdown({ children, isStreaming = false }: ChatMarkdownProps) {
return (
<Streamdown
mode={isStreaming ? 'streaming' : 'static'}
isAnimating={isStreaming}
parseIncompleteMarkdown={isStreaming}
caret={isStreaming ? 'block' : undefined}
className="prose prose-sm prose-invert max-w-none break-words text-text-primary prose-p:my-0 prose-p:leading-relaxed prose-headings:mb-2 prose-headings:mt-4 prose-headings:text-text-primary prose-headings:font-semibold prose-ul:my-2 prose-ol:my-2 prose-li:my-1 prose-strong:text-text-primary prose-a:text-text-secondary prose-a:underline prose-code:rounded prose-code:bg-bg-quaternary prose-code:px-1 prose-code:py-0.5 prose-code:text-text-primary prose-pre:my-3 prose-pre:bg-bg-primary prose-pre:text-text-secondary"
>
{children}
</Streamdown>
);
}