"use strict";

exports.__esModule = true;
exports.default = void 0;
var _unary2 = _interopRequireDefault(require("lodash/fp/unary"));
var _partial2 = _interopRequireDefault(require("lodash/fp/partial"));
var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _bubbling = _interopRequireDefault(require("../../util/bubbling"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const ModuleBubble = (props, context) => {
  const {
    skin
  } = context;
  const {
    onClick,
    status,
    iconColor,
    filtered,
    disabled
  } = props;
  const code = (0, _getOr2.default)('', ['icons', status], skin);
  const icon = String.fromCharCode(code);
  const click = !disabled && (0, _pipe2.default)(_bubbling.default, (0, _unary2.default)((0, _partial2.default)(onClick, [props])));
  return /*#__PURE__*/_react.default.createElement("div", {
    className: filtered ? _style.default.filtered : _style.default.modulewrapper,
    "data-name": "moduleBubble"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.bubble,
    onClick: click
  }, /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.bubbleBG
  }), /*#__PURE__*/_react.default.createElement("span", {
    "data-name": "icon",
    className: disabled ? _style.default.iconDisabled : _style.default.icon,
    style: {
      color: iconColor
    }
  }, icon)));
};
ModuleBubble.contextTypes = {
  skin: _provider.default.childContextTypes.skin
};
ModuleBubble.propTypes = process.env.NODE_ENV !== "production" ? {
  disabled: _propTypes.default.bool,
  filtered: _propTypes.default.bool,
  iconColor: _propTypes.default.string,
  status: _propTypes.default.string,
  onClick: _propTypes.default.func.isRequired
} : {};
var _default = exports.default = ModuleBubble;
//# sourceMappingURL=index.js.map