import React from 'react';

import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';

import InputCurrency from './index';
import InputCurrencyOptions from './InputCurrency.knobs.options';
import InputCurrencyDocs from './InputCurrency.md';

storiesOf('forms|atoms', module).addDecorator(withKnobs({ escapeHTML: false })).add('InputCurrency', function () {
  var inputTextOptionsWithKnobs = Object.assign.apply(Object, Object.entries(InputCurrencyOptions).map(function (_ref) {
    var _ref2;

    var k = _ref[0],
        v = _ref[1];
    return _ref2 = {}, _ref2[k] = v(), _ref2;
  }));
  var languages = new Map();
  languages.set('Chinese', 'zh-CN');
  languages.set('English', 'en-US');
  languages.set('French', 'fr-FR');
  languages.set('Russian', 'ru-RU');
  inputTextOptionsWithKnobs.language = languages.get(inputTextOptionsWithKnobs.language);
  return React.createElement(InputCurrency, inputTextOptionsWithKnobs);
}, { info: InputCurrencyDocs });