import OpenOrders from './OpenOrders.js';
import ApplicationManager from './ApplicationManager.js';
import ItemImageUploader from './ItemImageUploader.js';
import FrameAdmin from './FrameAdmin.js';
import _Admin from './_Admin.js';
//import _Image from './_Image.js';

var c = function(page){
  return (_Admin.page === page ? '.active' : '')
  }

var Admin = function(){
  var image;
  return {
    view: function(vnode){
      return m('.admin',[
                m('h1.text-center','Admin'),
                m('ul.tab.tab-block.c-hand', [
                  m('li.tab-item'+c(OpenOrders), {
                      onclick: function(){ _Admin.page = OpenOrders; }
                      }, [
                    m('a', 'Orders')
                    ]),
                  m('li.tab-item'+c(ApplicationManager), {
                      onclick: function(){ _Admin.page = ApplicationManager; }
                      }, [
                    m('a', 'Account Applications')
                    ]),
                  m('li.tab-item'+c(FrameAdmin), {
                      onclick: function(){ _Admin.page = FrameAdmin; }
                      }, [
                    m('a', 'Frames')
                    ]),
                  m('li.tab-item'+c(ItemImageUploader), {
                      onclick: function(){ _Admin.page = ItemImageUploader; }
                      }, [
                    m('a', 'Image Upload')
                    ])
                  ]),
                m(_Admin.page)
                ])
      }
    };
  };

export default Admin;