import React from 'react';
import { RouteView } from '../components/router';
import { WaitIcon, observer } from '../components';
import { WORKSPACE_CHANGING, WORKSPACE_CHANGE } from '../core/actions';
import LanguageSel from './user/language-sel';
import WorkspaceSel from './user/workspace-sel';
import Toolbar from './toolbar';
/** Pages of the system module */
import AdminRoutes from './admin/routes';
import WorkspaceView from './workspace';
import AdminUnitView from './adminunit';
import UnitView from './unit';
import CaseView from './case';
import CaseNewView from './case/new';
import Settings from './user/settings';
import ChangePassword from './user/change-password.jsx';
import Sync from './sync';
import Start from './start';
/**
* Initial page that declare all routes of the module
*/
class Routes extends React.Component {
handleEvent(action) {
if (action === WORKSPACE_CHANGING) {
this.setState({ changing: true });
return;
}
if (action === WORKSPACE_CHANGE) {
this.setState({ changing: false });
return;
}
}
render() {
const changing = this.state && this.state.changing;
if (changing) {
return