'use strict';

var React = require('react');
var ui_Label = require('../index-2bfd366f.js');
require('prop-types');
require('../stringSet-7aebf034.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

const ReactionBadge = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => {
  const {
    className = '',
    children,
    count = '',
    isAdd = false,
    selected = false,
    onClick = () => {/* noop */}
  } = props;
  const getClassNameTail = () => {
    if (selected && !isAdd) {
      return '--selected';
    }
    if (isAdd) {
      return '--is-add';
    }
    return '';
  };
  return /*#__PURE__*/React__default["default"].createElement("div", {
    className: [...(Array.isArray(className) ? className : [className]), `sendbird-reaction-badge${getClassNameTail()}`].join(' '),
    role: "button",
    ref: ref,
    onClick: onClick,
    onKeyDown: onClick,
    onTouchEnd: onClick,
    tabIndex: 0
  }, /*#__PURE__*/React__default["default"].createElement("div", {
    className: "sendbird-reaction-badge__inner"
  }, /*#__PURE__*/React__default["default"].createElement("div", {
    className: "sendbird-reaction-badge__inner__icon"
  }, children), /*#__PURE__*/React__default["default"].createElement(ui_Label.Label, {
    className: children && count && 'sendbird-reaction-badge__inner__count',
    type: ui_Label.LabelTypography.CAPTION_3,
    color: ui_Label.LabelColors.ONBACKGROUND_1
  }, count)));
});

module.exports = ReactionBadge;
//# sourceMappingURL=ReactionBadge.js.map
