import _Item from './_Item.js';
import _Navigation from './_Navigation.js';
import ItemBrowser from './ItemBrowser.js';
import _CollectionsList from './_CollectionsList.js';
import _User from './_User.js';

var CollectionsList = function(){
return {view: function(vnode){
  var brands = _CollectionsList.house_brands;
  return m('.container', [
    m('.columns', [
      m('.column.col-12', [
        m('h1.text-center', 'Collections')
        ])
      ]),
    m('.columns', brands.map(function(brand){
      return m('.column.col-4.col-md-6.col-xs-12.mt-1', [
        m('.card.c-hand', {onclick: function(e){
            //var item_browser_attrs = {};
            //item_browser_attrs.items = [];
            _Item.getItems({brand:brand}).then(function(items){
              //item_browser_attrs.items = items;
              _Navigation.navigateTo(ItemBrowser, {items: items});
              });
            }},[
          m('.card-header', [
            m('.card-title.h3.text-center', brand)
            ])
          ])
        ]);
        }
      ))
    ]);
}};
};

export default CollectionsList;