import React from 'react';
import { Helmet } from 'react-helmet';
import { Switch, Route } from 'react-router-dom';
import { NotificationContainer } from 'react-notifications';

import ProfilePage from '../../containers/ProfilePage/Loadable';
import NotFoundPage from '../../containers/NotFoundPage/Loadable';
import PostEditorPage from '../../containers/PostEditor/Loadable';
import ChatPage from '../../containers/ChatPage/Loadable';
import HomePage from '../../containers/HomePage/Loadable';


export default function App() {
  return (
    <div>
      <Helmet
        titleTemplate="%s - React.js Boilerplate"
        defaultTitle="React.js Boilerplate"
      >
        <meta name="description" content="A React.js Boilerplate application" />
      </Helmet>
      <Switch>
        <Route path="/editor" component={PostEditorPage} />
        <Route path="/message" component={ChatPage} />
        <Route path="/:username" component={ProfilePage} />
        <Route exact path="/" component={HomePage} />
        <Route path="/*" component={NotFoundPage} />
      </Switch>
      <NotificationContainer />
    </div>
  );
}
