"use strict";

exports.__esModule = true;
exports.default = void 0;
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _moduleBubble = _interopRequireDefault(require("../module-bubble"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function ModuleCard(props, context) {
  const {
    skin
  } = context;
  const {
    label,
    level,
    onClick
  } = props;
  const iconColor = (0, _getOr2.default)('#00B0FF', ['common', 'primary'], skin);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.defaultStyle,
    "data-name": "module-card",
    onClick: onClick
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _classnames.default)(_style.default.title, _style.default.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: label
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.level
  }, level), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.module
  }, /*#__PURE__*/_react.default.createElement(_moduleBubble.default, _extends({}, props, {
    iconColor: iconColor,
    onClick: onClick
  }))));
}
ModuleCard.propTypes = process.env.NODE_ENV !== "production" ? {
  label: _propTypes.default.string.isRequired,
  level: _propTypes.default.string.isRequired,
  onClick: _propTypes.default.func.isRequired
} : {};
ModuleCard.contextTypes = {
  skin: _provider.default.childContextTypes.skin
};
var _default = exports.default = ModuleCard;
//# sourceMappingURL=index.js.map