import React from 'react';

import { Route, Switch } from 'react-router-dom';
import MainLayout from './components/Layouts/main';

import {
  SignIn,
  Dashboard,
  LessonsSchedule,
  Teachers,
  Settings,
} from './pages';

import {
  HOME,
  LESSONS_SCHEDULE,
  SIGN_IN,
  TEACHERS,
  SETTINGS,
} from './lib/constants/routes';

export default () => (
  <Switch>
    <Route path={SIGN_IN} component={SignIn} />

    <MainLayout>
      <Switch>
        <Route exact path={HOME} component={Dashboard} />
        <Route path={LESSONS_SCHEDULE} component={LessonsSchedule} />
        <Route path={TEACHERS} component={Teachers} />
        <Route path={SETTINGS} component={Settings} />
      </Switch>
    </MainLayout>
  </Switch>
);
