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

import Link from './index';
import linkOptions from './Link.knob.options';
import LinkDocs from './Link.md';

storiesOf('molecules', module).addDecorator(withKnobs({ escapeHTML: false })).add('Link', function () {
  var optionsWithKnobs = Object.assign.apply(Object, Object.entries(linkOptions).map(function (_ref) {
    var _ref2;

    var k = _ref[0],
        v = _ref[1];
    return _ref2 = {}, _ref2[k] = v(Link.defaultProps[k]), _ref2;
  }));
  return React.createElement(Link, optionsWithKnobs);
}, { info: LinkDocs });