import React from 'react';
import PropTypes from 'prop-types';
import parse from 'react-html-parser';
import './style.css';

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

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

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

export default Email;