import Home from './Home.js';
import AboutUs from './AboutUs.js';
import Events from './Events.js';
import Policies from './Policies.js';
import ContactUs from './ContactUs.js';
import CollectionsList from './CollectionsList.js';
import DesignerCollectionsList from './DesignerCollectionsList.js';
import LensBrowser from './LensBrowser.js';
import Equipment from './Equipment.js';
import _Equipment from './_Equipment.js';
import Accessories from './Accessories.js';
import _Accessories from './_Accessories.js';
import _Item from './_Item.js';
import Admin from './Admin.js';
import UnderConstruction from './UnderConstruction.js';

var _Navigation = {};

_Navigation.is_hidden = true;

_Navigation.component = Home;
_Navigation.attrs = null;

_Navigation.navigateTo = function(component, attrs){
  _Navigation.component = component;
  _Navigation.attrs = attrs;
  };

_Navigation.navigateToFunction = function(component, attrs){
  return function(e){
    _Navigation.component = component;
    _Navigation.attrs = attrs;
    };
  };

_Navigation.menu = [
  {label: "Home", component: Home, attrs: null, children: [], run: null, restricted: false},
  {label: "About Us", component: AboutUs, attrs: null, children: [], run: null, restricted: false},
  {label: "Events", component: Events, attrs: null, children: [
    //{label: "Upcoming Trade Shows", component: Events, attrs: null, children: [], run: null, restricted: false}
    ], run: null, restricted: false},
  {label: "Collections", component: CollectionsList, attrs: null, children: [], run: null},
  {label: "Designer Collections", component: DesignerCollectionsList, attrs: null, children: [], run: null},
  //{label: "Lenses", component: LensBrowser, attrs: null, children: [], run: null, restricted: false},
  {label: "Lenses", component: UnderConstruction, attrs: null, children: [], run: null, restricted: false},
  {label: "Equipment", component: Equipment, attrs: null, children: [], run: function(){
                                _Equipment.items=[];
                                _Item.getItems({subtype:'equipment'})
                                  .then(function(items){ _Equipment.items=items; });
                                }, restricted: false},
  {label: "Accessories", component: Accessories, attrs: null, children: [], run: function(){
                                _Accessories.items=[];
                                _Item.getItems({subtype:'accessory'})
                                  .then(function(items){ _Accessories.items=items; });
                                }, restricted: false},
  {label: "Contact Us", component: ContactUs, attrs: null, children: [], run: null, restricted: false},
  {label: "Policies", component: Policies, attrs: null, children: [], run: null, restricted: false},
  {label: "Admin", component: Admin, attrs: null, children: [], run: null, restricted: 'admin'}
  ];

export default _Navigation;