import type { MouseEvent } from 'react' import { memo, } from 'react' import { useTranslation } from 'react-i18next' import { RiCursorLine, RiFunctionAddLine, RiHand, RiStickyNoteAddLine, } from '@remixicon/react' import { useNodesReadOnly, useWorkflowMoveMode, useWorkflowOrganize, } from '../hooks' import { ControlMode, } from '../types' import { useStore } from '../store' import AddBlock from './add-block' import TipPopup from './tip-popup' import { useOperator } from './hooks' import cn from '@/utils/classnames' const Control = () => { const { t } = useTranslation() const controlMode = useStore(s => s.controlMode) const { handleModePointer, handleModeHand } = useWorkflowMoveMode() const { handleLayout } = useWorkflowOrganize() const { handleAddNote } = useOperator() const { nodesReadOnly, getNodesReadOnly, } = useNodesReadOnly() const addNote = (e: MouseEvent) => { if (getNodesReadOnly()) return e.stopPropagation() handleAddNote() } return (
) } export default memo(Control)