Skip to content

Commit

Permalink
add mermaid story block (for diagrams)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiion committed Aug 8, 2024
1 parent 9b18937 commit 55e1d04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions apps/exhibition-live/.storybook/blocks/SBMermaid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";
import { Mermaid as MdxMermaid } from "mdx-mermaid/Mermaid";

export const SBMermaid = ({ chart }: { chart: string }) => {
if (!chart) {
return null;
}
return React.createElement(MdxMermaid, { chart });
};
4 changes: 3 additions & 1 deletion apps/exhibition-live/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@
"typescript": "5.1.6",
"webpack": "^5.75.0",
"vite": "^5.2.0",
"@vitejs/plugin-react-swc": "^3.5.0"
"@vitejs/plugin-react-swc": "^3.5.0",
"mermaid": "^10.9.1",
"mdx-mermaid": "^2.0.0"
}
}

0 comments on commit 55e1d04

Please sign in to comment.