import _unary from "lodash/fp/unary";
import _partial from "lodash/fp/partial";
import _pipe from "lodash/fp/pipe";
import _getOr from "lodash/fp/getOr";
import React from 'react';
import PropTypes from 'prop-types';
import Provider from '../../atom/provider';
import stopPropagation from '../../util/bubbling';
import style from './style.css';
const ModuleBubble = (props, context) => {
  const {
    skin
  } = context;
  const {
    onClick,
    status,
    iconColor,
    filtered,
    disabled
  } = props;
  const code = _getOr('', ['icons', status], skin);
  const icon = String.fromCharCode(code);
  const click = !disabled && _pipe(stopPropagation, _unary(_partial(onClick, [props])));
  return /*#__PURE__*/React.createElement("div", {
    className: filtered ? style.filtered : style.modulewrapper,
    "data-name": "moduleBubble"
  }, /*#__PURE__*/React.createElement("div", {
    className: style.bubble,
    onClick: click
  }, /*#__PURE__*/React.createElement("span", {
    className: style.bubbleBG
  }), /*#__PURE__*/React.createElement("span", {
    "data-name": "icon",
    className: disabled ? style.iconDisabled : style.icon,
    style: {
      color: iconColor
    }
  }, icon)));
};
ModuleBubble.contextTypes = {
  skin: Provider.childContextTypes.skin
};
ModuleBubble.propTypes = process.env.NODE_ENV !== "production" ? {
  disabled: PropTypes.bool,
  filtered: PropTypes.bool,
  iconColor: PropTypes.string,
  status: PropTypes.string,
  onClick: PropTypes.func.isRequired
} : {};
export default ModuleBubble;
//# sourceMappingURL=index.js.map