import React from "react";
import useOnClickOutside from "./useClickAwayListener";

function ClickAwayListener(props) {
  var children = props.children,
      onClickAway = props.onClickAway,
      _props$mouseEvent = props.mouseEvent,
      mouseEvent = _props$mouseEvent === void 0 ? "mousedown" : _props$mouseEvent;
  var nodeRef = React.useRef(null);
  useOnClickOutside(nodeRef, onClickAway, mouseEvent);
  return /*#__PURE__*/React.createElement("div", {
    ref: nodeRef
  }, children);
}

;
export default ClickAwayListener;