import { useState as t, useEffect as i } from "react";
const a = () => {
  const [r, e] = t(!1), [d, u] = t({ x: 0, y: 0 });
  return i(() => {
    const s = (n) => {
      e(!0), u({
        x: n.clientX,
        y: n.clientY
      });
    }, o = () => {
      e(!1);
    };
    return window.addEventListener("mousedown", s), window.addEventListener("mouseup", o), () => {
      window.removeEventListener("mousedown", s), window.removeEventListener("mouseup", o);
    };
  }, []), { isPressed: r, coordinates: d };
};
export {
  a as useMousePressed
};
