import { memo, useEffect, useState } from 'react';
import { useToast } from '../../toast';
import { useOfflineMode } from './useOfflineMode';
const NotifyOffline = () => {
    const { showError, showInfo } = useToast();
    const [isOfflineNotified, setIsOfflineNotified] = useState(false);
    const { isOffline } = useOfflineMode();
    useEffect(() => {
        if (!isOffline && isOfflineNotified)
            showInfo('The application is online');
        if (isOffline) {
            showError('The application is offline');
            setIsOfflineNotified(true);
        }
    }, [isOffline]);
    return null;
};
export default memo(NotifyOffline);
//# sourceMappingURL=notifyOffline.js.map