|
|
@@ -1,12 +1,11 @@
|
|
|
import { useCallback } from 'react';
|
|
|
|
|
|
-import { usePlayground, useService, WorkflowLinesManager } from '@flowgram.ai/free-layout-editor';
|
|
|
+import { useService, WorkflowLinesManager } from '@flowgram.ai/free-layout-editor';
|
|
|
import { IconButton, Tooltip } from '@douyinfe/semi-ui';
|
|
|
|
|
|
import { IconSwitchLine } from '../../assets/icon-switch-line';
|
|
|
|
|
|
export const SwitchLine = () => {
|
|
|
- const playground = usePlayground();
|
|
|
const linesManager = useService(WorkflowLinesManager);
|
|
|
const switchLine = useCallback(() => {
|
|
|
linesManager.switchLineType();
|
|
|
@@ -14,13 +13,7 @@ export const SwitchLine = () => {
|
|
|
|
|
|
return (
|
|
|
<Tooltip content={'Switch Line'}>
|
|
|
- <IconButton
|
|
|
- disabled={playground.config.readonly}
|
|
|
- type="tertiary"
|
|
|
- theme="borderless"
|
|
|
- onClick={switchLine}
|
|
|
- icon={IconSwitchLine}
|
|
|
- />
|
|
|
+ <IconButton type="tertiary" theme="borderless" onClick={switchLine} icon={IconSwitchLine} />
|
|
|
</Tooltip>
|
|
|
);
|
|
|
};
|