{"size": 598, "ext": "js", "max_stars_repo_path": "Scheduler.WebApp/ClientApp/src/components/jobs/index.js", "max_stars_repo_name": "knightpedro/scheduler", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Scheduler.WebApp/ClientApp/src/components/jobs/index.js", "max_issues_repo_name": "knightpedro/scheduler", "max_issues_repo_issues_event_min_datetime": "2021-09-03T02:54:10.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-03T02:54:10.000Z", "max_forks_repo_path": "Scheduler.WebApp/ClientApp/src/components/jobs/index.js", "max_forks_repo_name": "knightpedro/scheduler", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 23.92, "max_line_length": 66, "alphanum_fraction": 0.6421404682}
import React, { useEffect } from "react";
import JobsPage from "./JobsPage";
import JobsTablePage from "./JobsTablePage";
import { Switch, Route } from "react-router-dom";
import routes from "../../routes";
import { useDispatch } from "react-redux";
import { fetchAll } from "../../ducks/sharedActions";

const Jobs = () => {
  const dispatch = useDispatch();

  useEffect(() => {
    dispatch(fetchAll());
  }, [dispatch]);

  return (
    <Switch>
      <Route path={routes.jobs.table} component={JobsTablePage} />
      <Route component={JobsPage} />
    </Switch>
  );
};

export default Jobs;
