'use strict';

var React = require('react');

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

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

const ReactionButton = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => {
  const {
    className,
    width,
    height,
    selected,
    onClick,
    children
  } = props;
  return /*#__PURE__*/React__default["default"].createElement("div", {
    className: [...(Array.isArray(className) ? className : [className]), `sendbird-reaction-button${selected ? '--selected' : ''}`].join(' '),
    ref: ref,
    role: "button",
    style: {
      width,
      height
    },
    onClick: e => onClick(e),
    onKeyDown: e => onClick(e),
    onTouchEnd: e => {
      onClick(e);
      // to stop longpress
      e.stopPropagation();
      e.nativeEvent.stopImmediatePropagation();
    },
    tabIndex: 0
  }, /*#__PURE__*/React__default["default"].createElement("div", {
    className: "sendbird-reaction-button__inner"
  }, children));
});

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