// src/hooks/use-mobile.ts
import * as React from "react";
var MOBILE_BREAKPOINT = 768;
var MOBILE_MQ = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`;
function useIsMobile() {
  const [isMobile, setIsMobile] = React.useState(void 0);
  React.useLayoutEffect(() => {
    const read = () => {
      setIsMobile(window.matchMedia(MOBILE_MQ).matches);
    };
    const mql = window.matchMedia(MOBILE_MQ);
    mql.addEventListener("change", read);
    window.addEventListener("resize", read);
    const vv = window.visualViewport;
    vv?.addEventListener("resize", read);
    read();
    return () => {
      mql.removeEventListener("change", read);
      window.removeEventListener("resize", read);
      vv?.removeEventListener("resize", read);
    };
  }, []);
  return !!isMobile;
}
export {
  useIsMobile
};
//# sourceMappingURL=use-mobile.js.map