feat: integrate mermaidToExcalidraw

This commit is contained in:
Aakansha Doshi 2023-08-17 12:24:00 +05:30
parent 991f5570ce
commit 6a04ebc6db
8 changed files with 788 additions and 7 deletions

View 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;