"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = require("react");
const toast_1 = require("../../toast");
const useOfflineMode_1 = require("./useOfflineMode");
const NotifyOffline = () => {
    const { showError, showInfo } = (0, toast_1.useToast)();
    const [isOfflineNotified, setIsOfflineNotified] = (0, react_1.useState)(false);
    const { isOffline } = (0, useOfflineMode_1.useOfflineMode)();
    (0, react_1.useEffect)(() => {
        if (!isOffline && isOfflineNotified)
            showInfo('The application is online');
        if (isOffline) {
            showError('The application is offline');
            setIsOfflineNotified(true);
        }
    }, [isOffline]);
    return null;
};
exports.default = (0, react_1.memo)(NotifyOffline);
//# sourceMappingURL=notifyOffline.js.map