import { useContext, useMemo } from 'react';
import { LocaleContext } from "../LocaleContext";
export var useLocaleForControl = function useLocaleForControl(controlName, localeHelper) {
  var _useContext = useContext(LocaleContext),
    locale = _useContext.locale,
    langCode = _useContext.langCode;
  var localeFromContext = locale == null ? void 0 : locale[controlName];
  return useMemo(function () {
    return Object.assign({}, localeHelper.get(langCode), localeFromContext);
  }, [langCode, localeFromContext]);
};