1+ import { ResizableHandle , ResizablePanel , ResizablePanelGroup } from '@/components/ui/resizable' ;
12import { Sheet , SheetContent } from '@/components/ui/sheet' ;
3+ import { Spinner } from '@/components/ui/spinner' ;
24import WorkflowExecutionSheetWorkflowPanel from '@/ee/pages/embedded/workflow-executions/components/workflow-execution-sheet/WorkflowExecutionSheetWorkflowPanel' ;
35import { useGetComponentDefinitionsQuery } from '@/ee/shared/queries/embedded/componentDefinitions.queries' ;
46import { useGetIntegrationWorkflowExecutionQuery } from '@/ee/shared/queries/embedded/workflowExecutions.queries' ;
57import { WorkflowReadOnlyProvider } from '@/pages/platform/workflow-editor/providers/workflowEditorProvider' ;
8+ import { useCallback } from 'react' ;
69import { useShallow } from 'zustand/react/shallow' ;
710
811import useWorkflowExecutionSheetStore from '../../stores/useWorkflowExecutionSheetStore' ;
9- import WorkflowExecutionSheetAccordion from './WorkflowExecutionSheetAccordion ' ;
12+ import WorkflowExecutionSheetContent from './WorkflowExecutionSheetContent ' ;
1013
1114const WorkflowExecutionSheet = ( ) => {
1215 const { setWorkflowExecutionSheetOpen, workflowExecutionId, workflowExecutionSheetOpen} =
@@ -25,31 +28,45 @@ const WorkflowExecutionSheet = () => {
2528 workflowExecutionSheetOpen
2629 ) ;
2730
31+ const handleOpenChange = useCallback ( ( ) => {
32+ setWorkflowExecutionSheetOpen ( ! workflowExecutionSheetOpen ) ;
33+ } , [ workflowExecutionSheetOpen , setWorkflowExecutionSheetOpen ] ) ;
34+
2835 return (
29- < Sheet
30- onOpenChange = { ( ) => setWorkflowExecutionSheetOpen ( ! workflowExecutionSheetOpen ) }
31- open = { workflowExecutionSheetOpen }
32- >
33- < SheetContent className = "flex w-11/12 gap-0 p-0 sm:max-w-screen-xl" >
34- { workflowExecutionLoading && < span > Loading...</ span > }
35-
36- < div className = "flex w-7/12 flex-col border-r border-r-border/50 bg-white" >
37- { workflowExecution ?. job && (
38- < WorkflowExecutionSheetAccordion
39- job = { workflowExecution . job }
40- triggerExecution = { workflowExecution ?. triggerExecution }
41- />
42- ) }
43- </ div >
44-
45- { workflowExecution && (
46- < WorkflowReadOnlyProvider
47- value = { {
48- useGetComponentDefinitionsQuery : useGetComponentDefinitionsQuery ,
49- } }
50- >
51- < WorkflowExecutionSheetWorkflowPanel workflowExecution = { workflowExecution } />
52- </ WorkflowReadOnlyProvider >
36+ < Sheet onOpenChange = { handleOpenChange } open = { workflowExecutionSheetOpen } >
37+ < SheetContent className = "flex h-full w-[90%] gap-0 p-0 sm:max-w-[90%]" >
38+ { workflowExecutionLoading ? (
39+ < div className = "flex size-full items-center justify-center" >
40+ < Spinner className = "size-6" />
41+ </ div >
42+ ) : (
43+ < ResizablePanelGroup direction = "horizontal" >
44+ < ResizablePanel
45+ className = "flex h-full w-1/2 flex-col border-r border-stroke-neutral-secondary bg-surface-neutral-primary"
46+ defaultSize = { 50 }
47+ >
48+ { workflowExecution ?. job && (
49+ < WorkflowExecutionSheetContent
50+ job = { workflowExecution . job }
51+ triggerExecution = { workflowExecution ?. triggerExecution }
52+ />
53+ ) }
54+ </ ResizablePanel >
55+
56+ < ResizableHandle />
57+
58+ < ResizablePanel className = "w-1/2" defaultSize = { 50 } >
59+ { workflowExecution && (
60+ < WorkflowReadOnlyProvider
61+ value = { {
62+ useGetComponentDefinitionsQuery : useGetComponentDefinitionsQuery ,
63+ } }
64+ >
65+ < WorkflowExecutionSheetWorkflowPanel workflowExecution = { workflowExecution } />
66+ </ WorkflowReadOnlyProvider >
67+ ) }
68+ </ ResizablePanel >
69+ </ ResizablePanelGroup >
5370 ) }
5471 </ SheetContent >
5572 </ Sheet >
0 commit comments