import { React, useContext } from "react"; 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 { Tabs } from "@douyinfe/semi-ui"; import TableOverview from "./table_overview"; import ReferenceOverview from "./reference_overview"; import AreaOverview from "./area_overview"; import { Tab } from "../data/data"; import { LayoutContext, TabContext } from "../pages/editor"; import NotesOverview from "./notes_overview"; import Issues from "./issues"; 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 = (props) => { const { tab, setTab } = useContext(TabContext); const { layout } = useContext(LayoutContext); const tabList = [ { tab: "Tables", itemKey: Tab.tables }, { tab: "Relationships", itemKey: Tab.relationships }, { tab: "Subject Areas", itemKey: Tab.subject_areas }, { tab: "Editor", itemKey: Tab.editor }, { tab: "Notes", itemKey: Tab.notes }, ]; const contentList = [ , , , { props.setCode(e); }} />, , ]; return ( { setTab(key); }} collapsible > {contentList[parseInt(tab) - 1]} {layout.issues && ( )} props.setResize(true)} > ); }; export default EditorPanel;