aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/graph/GraphPane.tsx
blob: 67dbfcbda125fe79915f5f1280e9c9b38faf7d61 (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
34
/*
 * SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */

import Stack from '@mui/material/Stack';
import { Suspense, lazy } from 'react';

import Loading from '../Loading';

import type GraphStore from './GraphStore';

const GraphArea = lazy(() => import('./GraphArea'));

export default function GraphPane({
  graph,
}: {
  graph: GraphStore;
}): JSX.Element {
  return (
    <Stack
      direction="column"
      height="100%"
      overflow="auto"
      alignItems="center"
      justifyContent="center"
    >
      <Suspense fallback={<Loading />}>
        <GraphArea graph={graph} />
      </Suspense>
    </Stack>
  );
}