refact:generate unique meraid id using crypto.randomUUID

This commit is contained in:
asminkarki012
2025-04-11 11:48:07 +05:45
parent b1235f3ce0
commit c5a8f3abcd

View File

@@ -32,7 +32,7 @@ const MermaidRenderer: React.FC<MermaidRendererProps> = ({
const renderDiagram = async (): Promise<void> => {
try {
// Generate unique ID
const id = `mermaid-${Math.random().toString(36).substring(2, 9)}`;
const id = `mermaid-${crypto.randomUUID()}`;
// Render the diagram
const { svg } = await mermaid.render(id, code);