We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55d50aa commit c3e7dabCopy full SHA for c3e7dab
1 file changed
src/packages/ce/src/flow/hooks/Flow.view.hook.ts
@@ -0,0 +1,18 @@
1
+import {create} from "zustand"
2
+
3
+/**
4
+ * Shared state for the flow view side panels (file / execution). Lifting this out of
5
+ * the page component lets deeply nested components (e.g. the definition panel dialog)
6
+ * open a specific panel without prop drilling.
7
+ */
8
+interface FlowViewState {
9
+ tab?: string
10
+ setTab: (tab?: string) => void
11
+ toggleTab: (tab: string) => void
12
+}
13
14
+export const useFlowViewStore = create<FlowViewState>((setState) => ({
15
+ tab: undefined,
16
+ setTab: (tab) => setState({tab}),
17
+ toggleTab: (tab) => setState((state) => ({tab: state.tab === tab ? undefined : tab})),
18
+}))
0 commit comments