import useEngineContext from "../../../hooks/useEngineContext";

/**
 * @title: 获取引擎utils
 */
export var useEngineUtils = function useEngineUtils() {
  var engineContext = useEngineContext();
  var utils = engineContext.appHelper.utils || {};
  return utils;
};

/**
 * @title: 获取当前的语言
 */
export var useEngineLocale = function useEngineLocale() {
  var _utils$getApp, _app$locales;
  var utils = useEngineUtils();
  var app = (utils === null || utils === void 0 || (_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.call(utils)) || {};
  var locale = (app === null || app === void 0 || (_app$locales = app.locales) === null || _app$locales === void 0 ? void 0 : _app$locales.locale) || 'en';
  return locale;
};

/**
 * @title: 获取当前的货币符号
 */
export var useSymbol = function useSymbol() {
  var utils = useEngineUtils();
  var symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
  return symbol;
};