mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: integrate mermaidToExcalidraw
This commit is contained in:
parent
991f5570ce
commit
6a04ebc6db
8 changed files with 788 additions and 7 deletions
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;
|
Loading…
Add table
Add a link
Reference in a new issue