import { useMemo, useRef } from "react";
import { useNetwork } from "ahooks";
//#region src/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.ts
const useIsLowSpeedNetwork = () => {
	const networkState = useNetwork();
	const isLowSpeedNetwork = useRef(false);
	isLowSpeedNetwork.current = useMemo(() => {
		return [
			"slow-2g",
			"2g",
			"3g"
		].includes((networkState === null || networkState === void 0 ? void 0 : networkState.effectiveType) || "") || ((networkState === null || networkState === void 0 ? void 0 : networkState.downlink) || 20) <= 1 || ((networkState === null || networkState === void 0 ? void 0 : networkState.rtt) || 0) > 500;
	}, [networkState]);
	return isLowSpeedNetwork;
};
//#endregion
export { useIsLowSpeedNetwork as default };
