-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fullscreen option to stack state (#1130)
- Loading branch information
1 parent
ebc6af6
commit b52f3e8
Showing
2 changed files
with
103 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { EmptyState } from '@pluralsh/design-system' | ||
import { ReactNode } from 'react' | ||
import { useOutletContext } from 'react-router-dom' | ||
import { CodeEditor } from '@pluralsh/design-system' | ||
|
||
import { StackStateGraph } from 'components/stacks/state/StackStateGraph' | ||
import { ReactFlowProvider } from 'reactflow' | ||
|
||
import { StackRun } from '../../../../generated/graphql' | ||
|
||
export default function StackRunState(): ReactNode { | ||
const { stackRun } = useOutletContext<{ stackRun: StackRun }>() | ||
const value = JSON.stringify(stackRun.state?.state ?? {}, null, 2) | ||
const { state } = stackRun | ||
|
||
return ( | ||
<CodeEditor | ||
value={value} | ||
language="json" | ||
options={{ readOnly: true }} | ||
/> | ||
<div css={{ height: '100%' }}> | ||
{state ? ( | ||
<ReactFlowProvider> | ||
<StackStateGraph state={state} /> | ||
</ReactFlowProvider> | ||
) : ( | ||
<EmptyState message="No state found." /> | ||
)} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters