import React from 'react';  // eslint-disable-line no-unused-vars
import { Router, Route, IndexRedirect } from 'react-router';  // eslint-disable-line no-unused-vars

import { containers } from './containers';

export default (history) =>
  <Router history={history}>
    <Route path="/" component={containers.RequireAuthentication(containers.App)}>
      <IndexRedirect to="/users" />
      <Route path="configuration">
        <Route path="rule" component={containers.ConfigurationRule} />
        <Route path="import-export" component={containers.ConfigurationRule} />
      </Route>
      <Route path="groups" component={containers.Groups}>
        <Route path=":id" component={containers.Group} />
      </Route>
      <Route path="roles" component={containers.Roles}>
      </Route>
      <Route path="permissions" component={containers.Permissions}>
      </Route>
      <Route path="users" component={containers.Users}>
        <Route path=":id" component={containers.User} />
      </Route>
      <Route path="/configuration/api" component={containers.API} />
    </Route>
    <Route path="/login" component={containers.Login} />
  </Router>;
