"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useOfflineMode = void 0;
const react_1 = require("react");
const useOfflineMode = () => {
    const [isOffline, setIsOffline] = (0, react_1.useState)(false);
    const setOnline = () => setIsOffline(false);
    const setOffline = () => setIsOffline(true);
    (0, react_1.useEffect)(() => {
        window.addEventListener('online', setOnline);
        window.addEventListener('offline', setOffline);
        return () => {
            window.removeEventListener('online', setOnline);
            window.removeEventListener('offline', setOffline);
        };
    }, []);
    return { isOffline };
};
exports.useOfflineMode = useOfflineMode;
//# sourceMappingURL=useOfflineMode.js.map