'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _reactHtmlParser = require('react-html-parser');

var _reactHtmlParser2 = _interopRequireDefault(_reactHtmlParser);

require('./style.css');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Email = function Email(props) {
  var email = props.email,
      details = props.details;

  return _react2.default.createElement(
    'span',
    { className: 'ma__email' },
    _react2.default.createElement(
      'a',
      { href: 'mailto:' + email, className: 'ma__email__email' },
      email
    ),
    details && _react2.default.createElement(
      'p',
      { className: 'ma__contact__details' },
      (0, _reactHtmlParser2.default)(details)
    )
  );
};

Email.propTypes = process.env.NODE_ENV !== "production" ? {
  /** The email address. */
  email: _propTypes2.default.string.isRequired,
  /** Details around contacting the provided email. */
  details: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object])
} : {};

exports.default = Email;
module.exports = exports['default'];