import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs, text, select } from '@storybook/addon-knobs';
import EmergencyAlert from './index';
import Link from '../Link';

/* eslint-disable react/prop-types */
storiesOf('molecules', module).addDecorator(withKnobs({ escapeHTML: false })).add('EmergencyAlert', function () {
  var props = {
    theme: select('theme', {
      'c-warning (default)': 'c-warning',
      'c-primary': 'c-primary',
      'c-primary-alt': 'c-primary-alt',
      'c-error': 'c-error',
      'c-gray': 'c-gray'
    }, 'c-warning'),
    message: text('message', 'MassPort is operating with limited flights due to road closures.'),
    timeStamp: text('timeStamp', '02.15.16, 5:00 p.m'),
    link: function link(_ref) {
      var linkClasses = _ref.linkClasses,
          TextElement = _ref.TextElement;
      return React.createElement(
        Link,
        { classes: linkClasses, href: 'https://www.mass.gov' },
        React.createElement(
          TextElement,
          null,
          'Read full alert'
        )
      );
    }
  };
  return React.createElement(EmergencyAlert, props);
}, { info: '' });