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