{"size": 1618, "ext": "js", "max_stars_repo_path": "client/src/views/Reports/index.js", "max_stars_repo_name": "Shivanshudeveloper/reccruitersvickey", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/views/Reports/index.js", "max_issues_repo_name": "Shivanshudeveloper/reccruitersvickey", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/src/views/Reports/index.js", "max_forks_repo_name": "Shivanshudeveloper/reccruitersvickey", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.4181818182, "max_line_length": 89, "alphanum_fraction": 0.6038318912}
import { useEffect, useState } from "react";

// material-ui
import { Grid } from "@mui/material";

// project imports
import TotalWorkersHired from "../dashboard/Default/TotalWorkersHired";
import TotalContractsApproved from "../dashboard/Default/TotalContractsApproved";
import RejectedContracts from "../dashboard/Default/RejectedContracts";

import { gridSpacing } from "store/constant";
import { Link as RouterLink, useNavigate } from "react-router-dom";

// ==============================|| DEFAULT DASHBOARD ||============================== //
function getSessionStorageOrDefault(key, defaultValue) {
  const stored = sessionStorage.getItem(key);
  if (!stored) {
    return defaultValue;
  }

  return stored;
}
const Reports = () => {
  const [isLoading, setLoading] = useState(true);
  const userId = getSessionStorageOrDefault("userId1", "");
  const navigate = useNavigate();

  useEffect(() => {
    setLoading(false);
    if (userId === "") {
      navigate("/app/pages/login/login3", { replace: true });
    }
  }, []);

  return (
    <Grid container spacing={gridSpacing}>
      <Grid item xs={12}>
        <Grid container spacing={gridSpacing}>
          <Grid item lg={4} md={6} sm={6} xs={12}>
            <TotalWorkersHired isLoading={isLoading} />
          </Grid>
          <Grid item lg={4} md={6} sm={6} xs={12}>
            <TotalContractsApproved isLoading={isLoading} />
          </Grid>
          <Grid item lg={4} md={6} sm={6} xs={12}>
            <RejectedContracts isLoading={isLoading} />
          </Grid>
        </Grid>
      </Grid>
    </Grid>
  );
};

export default Reports;
