{"size": 651, "ext": "js", "max_stars_repo_path": "src/js/layout/index.js", "max_stars_repo_name": "elberthcorniell/task-manager-js", "max_stars_repo_stars_event_min_datetime": "2021-01-03T17:10:04.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-29T22:50:33.000Z", "max_issues_repo_path": "src/js/layout/index.js", "max_issues_repo_name": "elberthcorniell/task-manager-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/js/layout/index.js", "max_forks_repo_name": "elberthcorniell/task-manager-js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.34375, "max_line_length": 96, "alphanum_fraction": 0.5775729647}
import Navbar from './navbar';
import Home from './home';
import Tasks from './tasks';
import { getTab, setTab } from '../utils';

const mountTab = () => {
  document.getElementById('content').innerHTML = '';
  Navbar();
  switch (getTab()) {
    case 1:
      Home();
      break;
    case 2:
      Tasks();
      break;
    default:
      Home();
  }
};

const listen = () => {
  document.getElementById('groups').addEventListener('click', () => { setTab(1); mountTab(); });
  document.getElementById('tasks').addEventListener('click', () => { setTab(2); mountTab(); });
};

const mount = () => {
  mountTab();
  listen();
};

export default mount;
