aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/WorkArea.tsx
blob: adb29a5085feb111061ac575379617920b1e148b (plain) (blame)
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
/*
 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */

import { observer } from 'mobx-react-lite';

import DirectionalSplitPane from './DirectionalSplitPane';
import { useRootStore } from './RootStoreProvider';
import EditorPane from './editor/EditorPane';
import GraphPane from './graph/GraphPane';
import TablePane from './table/TablePane';

export default observer(function WorkArea(): JSX.Element {
  const { themeStore } = useRootStore();

  return (
    <DirectionalSplitPane
      primary={<EditorPane />}
      secondary={
        <DirectionalSplitPane
          primary={<GraphPane />}
          secondary={<TablePane />}
          primaryOnly={!themeStore.showTable}
          secondaryOnly={!themeStore.showGraph}
        />
      }
      primaryOnly={!themeStore.showGraph && !themeStore.showTable}
      secondaryOnly={!themeStore.showCode}
    />
  );
});