"use strict";

var React = require('react');

var Router = require('react-router');
var DefaultRoute = Router.DefaultRoute;
var NotFoundRoute = Router.NotFoundRoute;
var Route = Router.Route;
var Redirect = Router.Redirect;

var routes = (
    <Route name="app" path="/" handler={require('./components/app')}>
        <DefaultRoute handler={require('./components/homepage')} />
        <NotFoundRoute handler={require('./components/notFoundPage')} />

        <Route name="authors" handler={require('./components/authors/authorPage')} />
        <Route name="addAuthor" path="author" handler={require('./components/authors/manageAuthorPage')} />
        <Route name="manageAuthor" path="author/:id" handler={require('./components/authors/manageAuthorPage')} />
        <Route name="about" handler={require('./components/about/aboutpage')} />
        <Route name="addCourses" path="course" handler={require('./components/courses/manageCoursePage')} />
        <Route name="courses" handler={require('./components/courses/coursePage')} />
        <Route name="tutorials" handler={require('./components/tutorials/tutorialspage')} />

        <Redirect from="about-us" to="about" />
        <Redirect from="awthurs" to="authors" />
        <Redirect from="about/*" to="about" />
    </Route>
);

module.exports = routes;
