var React = require('react');
var Router = require('react-router'),
    Route = Router.Route, DefaultRoute = Router.DefaultRoute;
var RouteHandler = Router.RouteHandler;
var Navigation = Router.Navigation;

var ItemWithDetailsPage = require('./components/items/itemWithDetailsPage');
var ItemList = require('./components/items/itemList');
var SectionsListComponent = require('./components/shared/sectionsListComponent');
var AllItems = require('./components/items/allItems');
var ItemGroupPage = require('./components/items/itemGroupPage');
var CartPage = require('./components/cart/cartPage');
var CheckoutPage = require('./components/cart/checkoutPage');
var RootApp = require('./components/rootApp');
var StartPage = require('./components/startPage/startPage');
var ByCategory = require('./components/browsing/byCategory');
var BySubCategory = require('./components/browsing/bySubCategory');
var BySection = require('./components/browsing/bySection');
var ThankYouPage = require('./components/thankyou/thankYouPage');
var AboutUsPage = require('./components/about/aboutUsPage');
// var Register = require('./components/account/register');
// var Login = require('./components/account/login');
var SearchResultsPage = require('./components/search/searchResultsPage');


var routes = (
    <Route name='app' path='/' handler={RootApp}>
      <Route name='sekcija' path='sekcija/:id/:name' handler={BySection} />
      <Route name='artikal' path="artikal/:id/*" handler={ItemWithDetailsPage} />
      <Route name='grupa' path="grupa/:id/*" handler={ItemGroupPage} />
      <Route name='korpa' path="/korpa" handler={CartPage} />
      <Route name='dostava' path="/dostava" handler={CheckoutPage} />
      {/*<Route name='registracija' path="/registracija" handler={Register} />*/}
      {/*<Route name='login' path="/login" handler={Login} />*/}
      <Route name='podkategorija' path="/podkategorija/:id/*" handler={BySubCategory} />
      <Route name='byCat' path="sekcija/:sekcijaName/kategorija/:id/*" handler={ByCategory} />
      <Route name='hvala' path="/hvala" handler={ThankYouPage} />
      <Route name='onama' path="/o-nama" handler={AboutUsPage} />
      <Route name='pretraga' path="/pretraga" handler={SearchResultsPage} />
      <DefaultRoute handler={StartPage}/>
    </Route>
    );

var router = Router.create({
  routes: routes,
  location: Router.HistoryLocation
});

router.run(function (Handler, state) { 
  

});

module.exports = router;
