forked from Cloud-Pipelines/pipeline-editor
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPipelineRunPage.tsx
More file actions
59 lines (52 loc) · 1.78 KB
/
PipelineRunPage.tsx
File metadata and controls
59 lines (52 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { MiniMap, type ReactFlowProps } from "@xyflow/react";
import { useCallback, useState } from "react";
import { FlowCanvas, FlowControls } from "@/components/shared/ReactFlow";
import { BlockStack, InlineStack } from "@/components/ui/layout";
import { ComponentLibraryProvider } from "@/providers/ComponentLibraryProvider";
import { ContextPanelProvider } from "@/providers/ContextPanelProvider";
import { CollapsibleContextPanel } from "../shared/ContextPanel/CollapsibleContextPanel";
import { RunDetails } from "./RunDetails";
const GRID_SIZE = 10;
const PipelineRunPage = () => {
const [flowConfig, setFlowConfig] = useState<ReactFlowProps>({
snapGrid: [GRID_SIZE, GRID_SIZE],
snapToGrid: true,
panOnDrag: true,
selectionOnDrag: false,
nodesDraggable: true,
});
const updateFlowConfig = useCallback(
(updatedConfig: Partial<ReactFlowProps>) => {
setFlowConfig((prevConfig) => ({
...prevConfig,
...updatedConfig,
}));
},
[],
);
return (
<ContextPanelProvider defaultContent={<RunDetails />}>
<ComponentLibraryProvider>
<InlineStack fill>
<BlockStack fill className="flex-1 relative">
<FlowCanvas
{...flowConfig}
readOnly
style={{ backgroundColor: "#dbdbdb" }}
>
<MiniMap position="bottom-left" pannable />
<FlowControls
className="ml-56! mb-6!"
config={flowConfig}
updateConfig={updateFlowConfig}
showInteractive={false}
/>
</FlowCanvas>
</BlockStack>
<CollapsibleContextPanel />
</InlineStack>
</ComponentLibraryProvider>
</ContextPanelProvider>
);
};
export default PipelineRunPage;