import { useState as o, useEffect as s } from "react";
const d = (i = 768) => {
  const [t, n] = o(!1);
  return s(() => {
    if (typeof window == "undefined") return;
    const e = () => n(window.innerWidth <= i && window.matchMedia("(pointer: coarse)").matches);
    return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
  }, [i]), t;
};
export {
  d as useIsMobile
};
