import { useState, useLayoutEffect } from "react";
import debounce from "lodash.debounce";
import { baseStyles } from "~/components/deprecated";
const useIsMobile = () => {
    const [isMobile, setIsMobile] = useState(false);
    useLayoutEffect(() => {
        const updateSize = () => {
            setIsMobile(window.innerWidth < baseStyles.screenSizes.tablet);
        };
        window.addEventListener("resize", debounce(updateSize, 250));
        updateSize();
        return () => window.removeEventListener("resize", updateSize);
    }, []);
    return isMobile;
};
export default useIsMobile;
//# sourceMappingURL=useIsMobile.js.map