import React, { memo, useCallback } from 'react';
import noop from 'lodash/noop';
import Icon from '../icon';
import { stopEvent, stopPropagation } from '../_util/EventManager';
var CloseButton = /*#__PURE__*/memo(function (props) {
  var _props$onClose = props.onClose,
      onClose = _props$onClose === void 0 ? noop : _props$onClose,
      value = props.value,
      index = props.index;
  var handleClick = useCallback(function (e) {
    stopEvent(e);
    onClose(e, value, index);
  }, [onClose, value, index]);
  return /*#__PURE__*/React.createElement(Icon, {
    type: "cancel",
    onClick: handleClick,
    onFocus: stopPropagation,
    onMouseDown: stopEvent,
    tabIndex: -1
  });
});
CloseButton.displayName = 'CloseButton';
export default CloseButton;
//# sourceMappingURL=CloseButton.js.map
