{"size": 1330, "ext": "js", "max_stars_repo_path": "src/containers/student/MainPanel.js", "max_stars_repo_name": "mtodescato/marvin", "max_stars_repo_stars_event_min_datetime": "2018-11-24T11:41:14.000Z", "max_stars_repo_stars_event_max_datetime": "2018-11-24T11:41:14.000Z", "max_issues_repo_path": "src/containers/student/MainPanel.js", "max_issues_repo_name": "mtodescato/marvin", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/containers/student/MainPanel.js", "max_forks_repo_name": "mtodescato/marvin", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.6666666667, "max_line_length": 77, "alphanum_fraction": 0.7067669173}
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import Dashboard from '../../components/shared/Dashboard';
import Home from '../../containers/student/Home';
import ListStudyCourses from '../../containers/student/ListStudyCourses';
import Booklet from '../../containers/student/Booklet';
import ListAvaiableExams from '../../containers/student/ListAvaiableExams';
import ListPendingResults from '../../containers/student/ListPendingResults';
import ShowMeTheCost from '../../components/shared/ShowMeTheCost';

const MainPanel = ({ DashboardComponent }) => (
  <div>
    <Dashboard Component={DashboardComponent} />
  </div>
);

MainPanel.propTypes = {
  DashboardComponent: PropTypes.func.isRequired,
};

const mapStateToProps = (state) => {
  switch (state['menu-entries'].id) {
    case 0:
      return { DashboardComponent: Home };
    case 1:
      return { DashboardComponent: Booklet };
    case 2:
      return { DashboardComponent: ListAvaiableExams };
    case 3:
      return { DashboardComponent: ListPendingResults };
    case 4:
      return { DashboardComponent: ListStudyCourses };
    case 5:
      return { DashboardComponent: ShowMeTheCost };
    default:
      return { DashboardComponent: Home };
  }
};

export default connect(mapStateToProps)(MainPanel);
