import { useEffect } from "react";
const useClickOutside = (refObject, callback) => {
  const handleClickOutside = (e) => {
    var _a;
    if (!((_a = refObject == null ? void 0 : refObject.current) == null ? void 0 : _a.contains(e.target))) {
      callback();
    }
  };
  useEffect(() => {
    document.addEventListener("mousedown", handleClickOutside);
    return () => document.removeEventListener("mousedown", handleClickOutside);
  });
};
export {
  useClickOutside
};
//# sourceMappingURL=useClickOutSide.js.map
