@credithub/harlan-components 1.28.1 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,8 +30,9 @@ import Section from '../interface/section';
30
30
  import StatusMessage from '../interface/statusMessage';
31
31
  import { Queries, RequestStatus } from '../webservice';
32
32
  var getPossuiPendenciaText = function (_a) {
33
- var ccf = _a.ccf, ultimoRegistroCCF = _a.ultimoRegistroCCF, dividasPublicas = _a.dividasPublicas, protestos = _a.protestos, processosJuridicos = _a.processosJuridicos;
33
+ var ccf = _a.ccf, ultimoRegistroCCF = _a.ultimoRegistroCCF, dividasPublicas = _a.dividasPublicas, protestos = _a.protestos, processosJuridicos = _a.processosJuridicos, receitaStatus = _a.receitaStatus;
34
34
  return [
35
+ receitaStatus ? "".concat(receitaStatus) : '',
35
36
  dividasPublicas
36
37
  ? "".concat(formatMoney(dividasPublicas), " em D\u00EDvidas P\u00FAblicas")
37
38
  : '',
@@ -51,14 +52,20 @@ var getPossuiPendenciaText = function (_a) {
51
52
  ].filter(function (x) { return !!x; });
52
53
  };
53
54
  var ConsultaSimplesSection = function (_a) {
55
+ var _b, _c;
54
56
  var documento = _a.documento, children = _a.children, onClose = _a.onClose, rest = __rest(_a, ["documento", "children", "onClose"]);
55
57
  var ctx = useContext(Queries.Finder);
56
58
  var data = useGlobalData().data;
59
+ var receitaStatus = ((_c = (_b = data.dossie) === null || _b === void 0 ? void 0 : _b.summary) === null || _c === void 0 ? void 0 : _c.receitaStatus) &&
60
+ data.dossie.summary.receitaStatus !== 'ATIVA'
61
+ ? data.dossie.summary.receitaStatus
62
+ : null;
57
63
  var possuiPendencias = data.ccf ||
58
64
  data.protestos ||
59
65
  data.dividasPublicas ||
60
- data.processosJuridicos;
61
- var possuiPendenciaText = getPossuiPendenciaText(data);
66
+ data.processosJuridicos ||
67
+ receitaStatus;
68
+ var possuiPendenciaText = getPossuiPendenciaText(__assign(__assign({}, data), { receitaStatus: receitaStatus }));
62
69
  var isError = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Error;
63
70
  var isLoading = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading;
64
71
  var statusType = isError
@@ -195,7 +195,7 @@ var Section = function (_a) {
195
195
  React.createElement(StatusMessage, { type: "warning" }, err.message))),
196
196
  actions: (React.createElement(React.Fragment, null,
197
197
  React.createElement(Button, { onClick: function () { return ctx.refetch(); } }, "Tentar Novamente")))
198
- }); } : _b, _c = _a.onLoading, onLoading = _c === void 0 ? function () { return React.createElement(React.Fragment, null); } : _c, ctx = _a.ctx, className = _a.className, _d = _a.hideHeader, hideHeader = _d === void 0 ? false : _d, _e = _a.minimized, minimized = _e === void 0 ? true : _e, headerProps = __rest(_a, ["onSuccess", "isError", "onLoading", "ctx", "className", "hideHeader", "minimized"]);
198
+ }); } : _b, _c = _a.onLoading, onLoading = _c === void 0 ? function () { return React.createElement(React.Fragment, null); } : _c, ctx = _a.ctx, className = _a.className, _d = _a.hideHeader, hideHeader = _d === void 0 ? false : _d, _e = _a.minimized, minimized = _e === void 0 ? false : _e, headerProps = __rest(_a, ["onSuccess", "isError", "onLoading", "ctx", "className", "hideHeader", "minimized"]);
199
199
  var _f = useToggle(!minimized), isOpen = _f[0], toggleOpen = _f[1];
200
200
  if (!ctx)
201
201
  return null;