"use strict";

exports.__esModule = true;
exports.useWidgetPageStatus = useWidgetPageStatus;
var _react = require("react");
var _providers = require("../providers");
function useWidgetPageStatus(widgetStatus) {
  const pageState = (0, _react.useContext)(_providers.entityPageContext);
  const pageStatus = pageState == null ? void 0 : pageState.initTask.status.status;
  const status = (0, _react.useMemo)(() => !pageState || pageStatus === 'success' ? widgetStatus : pageStatus, [pageStatus, widgetStatus]);
  return {
    status
  };
}
//# sourceMappingURL=useWidgetPageStatus.js.map