import type { FC } from 'react'; import { Select, Divider, Tooltip } from 'antd'; import { PlusOutlined, MinusOutlined, FileAddOutlined, UndoOutlined, RedoOutlined } from '@ant-design/icons' import clsx from 'clsx' import { Node } from '@antv/x6'; import { useTranslation } from 'react-i18next' import type { GraphRef } from '../types' interface CanvasToolbarProps { /** Currently selected node */ selectedNode: Node | null; miniMapRef: React.RefObject; graphRef: GraphRef; isHandMode: boolean; setIsHandMode: React.Dispatch>; zoomLevel: number; addNotes: () => void; canUndo: boolean; canRedo: boolean; onUndo: () => void; onRedo: () => void; } const CanvasToolbar: FC = ({ selectedNode, miniMapRef, graphRef, zoomLevel, canUndo, canRedo, onUndo, onRedo, addNotes, }) => { const { t } = useTranslation() return ( <> {/* 小地图 */}
{/* 缩放控制按钮 */}
graphRef.current?.zoom(-0.1)} />