import { useOfflineMode } from "./useOfflineMode.js";
import { useToast } from "../../toast/useToast.js";
import { memo, useEffect, useState } from "react";

//#region src/core/vuiProvider/notifyOffline.ts
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;
};
var notifyOffline_default = memo(NotifyOffline);

//#endregion
export { notifyOffline_default as default };
globalThis.__vuiVersion__ = "4.0.0-beta.1"
//# sourceMappingURL=notifyOffline.js.map