import _getOr from "lodash/fp/getOr";
import React from 'react';
import PropTypes from 'prop-types';
import stopPropagation from '../../../util/bubbling';
import Provider from '../../../atom/provider';
import Button from '../../../atom/button';
import style from './dashboard-popin.css';
const DashboardPopin = (props, context) => {
  const {
    skin
  } = context;
  const {
    ctaLabel,
    ctaOnClick,
    header,
    closeOnClick,
    content
  } = props;
  function createMarkup() {
    return {
      __html: content
    };
  }
  const primary = _getOr('#00B0FF', ['common', 'primary'], skin);
  return /*#__PURE__*/React.createElement("div", {
    className: style.defaultStyle,
    onClick: closeOnClick
  }, /*#__PURE__*/React.createElement("div", {
    className: style.popin,
    onClick: stopPropagation
  }, /*#__PURE__*/React.createElement("div", {
    className: style.header,
    onClick: closeOnClick,
    "data-name": "popin-header"
  }, header), /*#__PURE__*/React.createElement("div", {
    className: style.content
  }, /*#__PURE__*/React.createElement("div", {
    // eslint-disable-next-line react/no-danger
    dangerouslySetInnerHTML: createMarkup()
  })), /*#__PURE__*/React.createElement(Button, {
    type: "link",
    onClick: ctaOnClick,
    submitValue: ctaLabel,
    style: {
      backgroundColor: primary
    }
  })));
};
DashboardPopin.contextTypes = {
  skin: Provider.childContextTypes.skin
};
DashboardPopin.propTypes = process.env.NODE_ENV !== "production" ? {
  ctaLabel: PropTypes.string,
  ctaOnClick: PropTypes.func,
  closeOnClick: PropTypes.func,
  header: PropTypes.string,
  content: PropTypes.string
} : {};
export default DashboardPopin;
//# sourceMappingURL=dashboard-popin.js.map