mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-08-27 20:27:12 +02:00
feat: integrate mermaidToExcalidraw
This commit is contained in:
23
src/components/MermaidToExcalidraw.tsx
Normal file
23
src/components/MermaidToExcalidraw.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { AppState } from "../types";
|
||||
import { updateActiveTool } from "../utils";
|
||||
import { useExcalidrawSetAppState } from "./App";
|
||||
import { Dialog } from "./Dialog";
|
||||
|
||||
const MermaidToExcalidraw = ({ appState }: { appState: AppState }) => {
|
||||
const setAppState = useExcalidrawSetAppState();
|
||||
if (appState?.activeTool?.type !== "mermaid") {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Dialog
|
||||
onCloseRequest={() => {
|
||||
const activeTool = updateActiveTool(appState, { type: "selection" });
|
||||
setAppState({ activeTool });
|
||||
}}
|
||||
title="Mermaid to Excalidraw"
|
||||
>
|
||||
<div>Hello</div>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
export default MermaidToExcalidraw;
|
Reference in New Issue
Block a user