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

import compHeadingOptions from './CompHeading.knob.options';

import CompHeading from './index';
import CompHeadingDocs from './CompHeading.md';

storiesOf('atoms/headings', module).addDecorator(withKnobs({ escapeHTML: false })).add('Comp Heading', function () {
  var compOptionsWithKnobs = Object.assign.apply(Object, Object.entries(compHeadingOptions).map(function (_ref) {
    var _ref2;

    var k = _ref[0],
        v = _ref[1];
    return _ref2 = {}, _ref2[k] = v(CompHeading.defaultProps[k]), _ref2;
  }));
  return React.createElement(CompHeading, compOptionsWithKnobs);
}, { info: CompHeadingDocs });