import { useEffect, useState } from "react";
import { DEFAULT_COUNTRY_CODE } from "../constants.js";
import { getClientSettings } from "../functions/get-client-settings.js";
import { getTenantCountryCode } from "../functions/get-tenant-country-code.js";
const useMapSettings = () => {
  const [isLoading, setIsLoading] = useState(true);
  const [isMapEnabled, setIsMapEnabled] = useState(false);
  const [countryCode, setCountryCode] = useState(DEFAULT_COUNTRY_CODE);
  useEffect(() => {
    setIsLoading(true);
    Promise.all([getClientSettings(), getTenantCountryCode()]).then(
      ([isMapEnabledResponse, countryCodeResponse]) => {
        setIsMapEnabled(isMapEnabledResponse);
        setCountryCode(countryCodeResponse);
      }
    ).finally(() => setIsLoading(false));
  }, []);
  return { isLoading, isMapEnabled, countryCode };
};
export {
  useMapSettings
};
//# sourceMappingURL=use-map-settings.js.map
