{"size": 665, "ext": "js", "max_stars_repo_path": "client/src/containers/App/App.js", "max_stars_repo_name": "Angelmmiguel/discuzzion", "max_stars_repo_stars_event_min_datetime": "2017-05-12T10:05:38.000Z", "max_stars_repo_stars_event_max_datetime": "2018-03-01T09:58:58.000Z", "max_issues_repo_path": "client/src/containers/App/App.js", "max_issues_repo_name": "Angelmmiguel/discuzzion", "max_issues_repo_issues_event_min_datetime": "2017-05-16T09:49:54.000Z", "max_issues_repo_issues_event_max_datetime": "2018-02-28T21:00:49.000Z", "max_forks_repo_path": "client/src/containers/App/App.js", "max_forks_repo_name": "Angelmmiguel/discuzzion", "max_forks_repo_forks_event_min_datetime": "2017-05-25T19:43:43.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-25T19:43:43.000Z"}
{"max_stars_count": 7, "max_issues_count": 7, "max_forks_count": 1, "avg_line_length": 24.6296296296, "max_line_length": 63, "alphanum_fraction": 0.6736842105}
import { createElement } from 'react';
import { connect } from 'react-redux';
import { routeNodeSelector } from 'redux-router5';

// Containers
import Home from '../Home';
import Room from '../Room';
import Join from '../Join';
import NotFound from '../../components/NotFound';

// Containers for routes
const containers = {
  'index': Home,
  'join': Join,
  'room': Room
};

// Basic App routing
const App = props => {
  const { route } = props;
  const segment = route ? route.name.split('.')[0] : undefined;
  // Initialize the component
  return createElement(containers[segment] || NotFound);
}

export default connect((state) => routeNodeSelector(''))(App);
