import { memo, useRef, } from 'react' import cn from 'classnames' import { useTranslation } from 'react-i18next' import { useClickAway } from 'ahooks' import ShortcutsName from './shortcuts-name' import { useStore } from './store' import { useDSL, useNodesInteractions, usePanelInteractions, useWorkflowStartRun, } from './hooks' import AddBlock from './operator/add-block' import { useOperator } from './operator/hooks' const PanelContextmenu = () => { const { t } = useTranslation() const ref = useRef(null) const panelMenu = useStore(s => s.panelMenu) const clipboardElements = useStore(s => s.clipboardElements) const setShowImportDSLModal = useStore(s => s.setShowImportDSLModal) const { handleNodesPaste } = useNodesInteractions() const { handlePaneContextmenuCancel } = usePanelInteractions() const { handleStartWorkflowRun } = useWorkflowStartRun() const { handleAddNote } = useOperator() const { handleExportDSL } = useDSL() useClickAway(() => { handlePaneContextmenuCancel() }, ref) const renderTrigger = () => { return (