"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useResize = void 0;
const react_1 = require("react");
const useResize = () => {
    const [width, setWidth] = (0, react_1.useState)(typeof window !== 'undefined' ? window.innerWidth : 0);
    (0, react_1.useEffect)(() => {
        const handleResize = () => setWidth(window.innerWidth);
        window.addEventListener('resize', handleResize);
        return () => window.removeEventListener('resize', handleResize);
    }, []);
    return width;
};
exports.useResize = useResize;
//# sourceMappingURL=useResize.js.map