import React, { useEffect, useReducer } from 'react'; import 'antd/es/tabs/style'; import 'antd/es/empty/style'; import styles from './index.module.less'; import { Graph } from '@antv/x6'; import { Empty, Tabs } from 'antd'; import Basic from './mods/basic'; // import TestCase from './mods/testCase'; const { TabPane } = Tabs; interface IProps { flowChart: Graph; } const SettingBar: React.FC = (props) => { const { flowChart } = props; const forceUpdate = useReducer((n) => n + 1, 0)[1]; useEffect(() => { flowChart.on('settingBar:forceUpdate', forceUpdate); return () => { flowChart.off('settingBar:forceUpdate'); }; }, []); const nodes = flowChart.getSelectedCells().filter((v) => v.shape !== 'edge'); if (nodes.length === 1) { return (
{/* */}
); } else { return (
); } }; export default SettingBar;