Skip to content

Commit

Permalink
💄 style: support Mermaid in Artifacts (lobehub#5947)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored and likaiqiang committed Feb 12, 2025
1 parent 6441db1 commit d848075
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/features/Portal/Artifacts/Body/Renderer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Markdown } from '@lobehub/ui';
import { Markdown, Mermaid } from '@lobehub/ui';
import dynamic from 'next/dynamic';
import { memo } from 'react';

Expand All @@ -17,6 +17,10 @@ const Renderer = memo<{ content: string; type?: string }>(({ content, type }) =>
return <SVGRender content={content} />;
}

case 'application/lobe.artifacts.mermaid': {
return <Mermaid type={'pure'}>{content}</Mermaid>;
}

case 'text/markdown': {
return <Markdown style={{ overflow: 'auto' }}>{content}</Markdown>;
}
Expand Down

0 comments on commit d848075

Please # to comment.