import { React, useState, useRef, memo } from "react"; import { ResizableBox } from "react-resizable"; import CodeMirror from "@uiw/react-codemirror"; import { createTheme } from "@uiw/codemirror-themes"; import { sql } from "@codemirror/lang-sql"; import { tags as t } from "@lezer/highlight"; import Shape from "./shape"; import { saveAs } from "file-saver"; import html2canvas from "html2canvas"; import { Parser } from "node-sql-parser"; import { Tabs } from "@douyinfe/semi-ui"; import "react-resizable/css/styles.css"; import TableOverview from "./table_overview"; import ReferenceOverview from "./reference_overview"; import { defaultTableTheme } from "../data/data"; const myTheme = createTheme({ dark: "light", settings: {}, styles: [ { tag: t.comment, color: "#8ab0ed" }, { tag: t.string, color: "#e68e29" }, { tag: t.number, color: "#e68e29" }, { tag: t.keyword, color: "#295be6" }, { tag: t.variableName, color: "#1a00db" }, { tag: t.typeName, color: "#295be6" }, { tag: t.tagName, color: "#008a02" }, ], }); const EditorPanel = memo(function EditorPanel(props) { const [tab, setTab] = useState("1"); const map = useRef(new Map()); const tabList = [ { tab: "Tables", itemKey: "1" }, { tab: "References", itemKey: "2" }, { tab: "Shapes", itemKey: "3" }, { tab: "Editor", itemKey: "4" }, ]; const contentList = [