'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _react3 = require('@storybook/react');

var _addonKnobs = require('@storybook/addon-knobs');

var _index = require('./index');

var _index2 = _interopRequireDefault(_index);

var _UtilityNav = require('./UtilityNav.md');

var _UtilityNav2 = _interopRequireDefault(_UtilityNav);

var _UtilityNavKnob = require('./UtilityNav.knob.options');

var _UtilityNavKnob2 = _interopRequireDefault(_UtilityNavKnob);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(0, _react3.storiesOf)('organisms', module).addDecorator((0, _addonKnobs.withKnobs)({ escapeHTML: false })).add('UtilityNav', function () {
  var googleLanguages = (0, _addonKnobs.boolean)('UtilityNav googleLanguages', false);
  var newProps = {
    items: [],
    googleLanguages: googleLanguages
  };
  newProps.items = _UtilityNavKnob2.default.items.map(function (item, itemIndex) {
    var icons = {
      building: 'building',
      login: 'login'
    };
    var storyProps = {
      text: (0, _addonKnobs.text)('UtilityNav item' + itemIndex + ': text', item.text, 'Item ' + itemIndex),
      ariaLabelText: (0, _addonKnobs.text)('UtilityNav item' + itemIndex + ': ariaLabelText', item.ariaLabelText, 'Item ' + itemIndex),
      closeText: (0, _addonKnobs.text)('UtilityNav item' + itemIndex + ': closeText', item.closeText, 'Item ' + itemIndex),
      href: (0, _addonKnobs.text)('UtilityNav item' + itemIndex + ': href', item.href, 'Item ' + itemIndex),
      panel: (0, _addonKnobs.object)('UtilityNav item' + itemIndex + ': panel', item.panel, 'Item ' + itemIndex)
    };
    storyProps.icon = (0, _addonKnobs.select)('UtilityNav item' + itemIndex + ': icons', icons, item.icon, 'Item ' + itemIndex);
    return storyProps;
  });
  return _react2.default.createElement(_index2.default, newProps);
}, { info: _UtilityNav2.default });