forked from module-federation/module-federation-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWidget.js
More file actions
27 lines (24 loc) · 653 Bytes
/
Widget.js
File metadata and controls
27 lines (24 loc) · 653 Bytes
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
import React from "react";
import { CircularProgress, makeStyles, Paper, Box } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
paper: {
padding: theme.spacing(2),
display: "flex",
overflow: "auto",
},
}));
function Loading() {
return (
<Box display="flex" flex={1} justifyContent="center" alignItems="center">
<CircularProgress />
</Box>
);
}
export default function Widget(props) {
const classes = useStyles();
return (
<Paper style={{ height: props.height }} className={classes.paper}>
<React.Suspense fallback={<Loading />}>{props.children}</React.Suspense>
</Paper>
);
}