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

import InputSlider from './index';
import InputSliderOptions from './InputSlider.knobs.options';
import InputSliderDocs from './InputSlider.md';

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

    var k = _ref[0],
        v = _ref[1];
    return _ref2 = {}, _ref2[k] = v(), _ref2;
  }));
  var ticks = [];
  Object.keys(inputTextOptionsWithKnobs.ticks).forEach(function (tick) {
    return ticks.push([tick, inputTextOptionsWithKnobs.ticks[tick]]);
  });
  inputTextOptionsWithKnobs.ticks = ticks;
  return React.createElement(InputSlider, inputTextOptionsWithKnobs);
}, { info: InputSliderDocs });