{"size": 622, "ext": "js", "max_stars_repo_path": "src/SensorFusion.Web.Api/ClientApp/src/components/AppPage.js", "max_stars_repo_name": "seclerp/SensorFusion", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/SensorFusion.Web.Api/ClientApp/src/components/AppPage.js", "max_issues_repo_name": "seclerp/SensorFusion", "max_issues_repo_issues_event_min_datetime": "2019-04-05T18:38:10.000Z", "max_issues_repo_issues_event_max_datetime": "2019-06-30T12:26:17.000Z", "max_forks_repo_path": "src/SensorFusion.Web.Api/ClientApp/src/components/AppPage.js", "max_forks_repo_name": "AndrewRublyov/SensorFusion", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": null, "avg_line_length": 21.4482758621, "max_line_length": 62, "alphanum_fraction": 0.6688102894}
import React from 'react';
import {makeStyles} from "@material-ui/core"
import PropTypes from "prop-types";
import AppLoading from "./AppLoading";

const useStyles = makeStyles(theme => ({
  toolbar: theme.mixins.toolbar,
}));

function AppPage(props) {
  const classes = useStyles();

  const renderLoading = () =>
    <AppLoading/>;

  const renderContent = () =>
    <div style={{height: "100%"}}>
      <div className={classes.toolbar} />
      {props.children}
    </div>;

  return !props.isLoading ? renderContent() : renderLoading();
}

AppPage.propTypes = {
  isLoading: PropTypes.bool
};

export default AppPage;