Loading.tsx 681 B

12345678910111213141516171819
  1. import React from "react";
  2. import { Button, Spinner } from "react-bootstrap";
  3. import { Grid } from "@material-ui/core";
  4. import { GridSize } from "@material-ui/core/Grid/Grid";
  5. const Loading = (props: { target?: string; gridSize?: GridSize }) => {
  6. const { gridSize, target } = props;
  7. const title = target ? `Fetching ${target}` : "Connecting to Websocket";
  8. return (
  9. <Grid style={{ textAlign: "center" }} lg={gridSize ? gridSize : 6} item>
  10. <Button variant="warning" className="text-left m-1 py-0 mr-2 mt-3">
  11. <Spinner animation="border" variant="dark" size="sm" className="mr-1" />
  12. {title}
  13. </Button>
  14. </Grid>
  15. );
  16. };
  17. export default Loading;