d13100ebf3
Update draft releases / main (push) Has been cancelled
Build and push docs image / build-image (push) Has been cancelled
Build Web Application / build-web (macos-latest) (push) Has been cancelled
Build Web Application / build-web (ubuntu-latest) (push) Has been cancelled
Python Code Quality Checks / build (push) Has been cancelled
Test Python / test-python (macos-latest, 3.10) (push) Has been cancelled
Test Python / test-python (macos-latest, 3.11) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.10) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.11) (push) Has been cancelled
25 lines
664 B
TypeScript
25 lines
664 B
TypeScript
import { IFlowData } from '@/types/flow';
|
|
import { mapUnderlineToHump } from '@/utils/flow';
|
|
import React from 'react';
|
|
import ReactFlow, { Background } from 'reactflow';
|
|
import 'reactflow/dist/style.css';
|
|
import ButtonEdge from './button-edge';
|
|
|
|
const PreviewFlow: React.FC<{ flowData: IFlowData; minZoom?: number }> = ({ flowData, minZoom }) => {
|
|
const data = mapUnderlineToHump(flowData);
|
|
|
|
return (
|
|
<ReactFlow
|
|
nodes={data.nodes}
|
|
edges={data.edges}
|
|
edgeTypes={{ buttonedge: ButtonEdge }}
|
|
fitView
|
|
minZoom={minZoom || 0.1}
|
|
>
|
|
<Background color='#aaa' gap={16} />
|
|
</ReactFlow>
|
|
);
|
|
};
|
|
|
|
export default PreviewFlow;
|