@credithub/harlan-components 1.42.0 → 1.43.1

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.
@@ -79,7 +79,9 @@ var ConsultaSimplesSection = function (_a) {
79
79
  React.createElement(StatusMessage, null, format(new Date(), "dd/MM/yyyy 'às' HH:mm")),
80
80
  React.createElement(StatusMessage, { type: "found" }, formatDocument(documento)),
81
81
  isError && (ctx === null || ctx === void 0 ? void 0 : ctx.error) && (React.createElement(StatusMessage, { type: statusType }, ctx.error.message)),
82
- possuiPendenciaText.length ? (possuiPendenciaText.map(function (text) { return (React.createElement(StatusMessage, { key: text, type: "error" }, text)); })) : (React.createElement(StatusMessage, { type: statusType }, "Nenhum registro encontrado"))), onClose: onClose, icon: ConsultaSimplesIcon, variant: isLoading ? 'loading' : 'default', ctx: ctx, loadingProps: {
82
+ !isLoading &&
83
+ possuiPendenciaText.length === 0 &&
84
+ !possuiPendencias ? (React.createElement(StatusMessage, { type: statusType }, "Nenhum registro encontrado")) : (possuiPendenciaText.map(function (text) { return (React.createElement(StatusMessage, { key: text, type: "error" }, text)); }))), onClose: onClose, icon: ConsultaSimplesIcon, variant: isLoading ? 'loading' : 'default', ctx: ctx, loadingProps: {
83
85
  percentage: (ctx === null || ctx === void 0 ? void 0 : ctx.progress) || 0,
84
86
  hidden: !isLoading
85
87
  } }, rest), children));
@@ -3,6 +3,7 @@ interface DossieProps {
3
3
  documento: string;
4
4
  rfbResponse?: Document;
5
5
  onOpenNewTransactionModal?: () => void;
6
+ printMode?: boolean;
6
7
  }
7
8
  declare const Dossie: React.FC<DossieProps>;
8
9
  export default Dossie;
@@ -34,7 +34,7 @@ var GenerativeAIContainer = styled.div(templateObject_3 || (templateObject_3 = _
34
34
  return theme.colors.white;
35
35
  });
36
36
  var Dossie = function (_a) {
37
- var documento = _a.documento;
37
+ var documento = _a.documento, printMode = _a.printMode;
38
38
  var ctx = useContext(Queries.Finder);
39
39
  var rfbResponse = useConsultaRfb().rfbResponse;
40
40
  var setData = useGlobalData().setData;
@@ -71,7 +71,7 @@ var Dossie = function (_a) {
71
71
  React.createElement(DossieCarrousel, null),
72
72
  React.createElement(Summary, { finderResponse: data, rfbResponse: rfbResponse, document: document })),
73
73
  React.createElement(TransactionsTable, { events: XPathUtils.select('//historico/consulta', data) || [] })),
74
- React.createElement(GenerativeAIContainer, null,
74
+ !printMode && React.createElement(GenerativeAIContainer, null,
75
75
  React.createElement(GenerativeAI, { documento: document }))));
76
76
  };
77
77
  return (React.createElement(Section, { ctx: ctx, hideHeader: true, minimized: false, isError: function (e) { return response(e); }, onSuccess: response }));
@@ -241,9 +241,10 @@ var GenerativeAI = function (_a) {
241
241
  React.createElement(InitialMessageContent, null,
242
242
  React.createElement("div", { className: "icon-and-text" },
243
243
  React.createElement(Credithub, { size: 18, className: "initial-icon" }),
244
- React.createElement("span", null, isLoading &&
245
- currentMessageIndex === 0 &&
246
- !((_b = messageHistory[0]) === null || _b === void 0 ? void 0 : _b.content) ? (React.createElement(LoadingDots, null)) : shouldStartTyping &&
244
+ React.createElement("span", null, !isGlobalDataLoaded ||
245
+ (isLoading &&
246
+ currentMessageIndex === 0 &&
247
+ !((_b = messageHistory[0]) === null || _b === void 0 ? void 0 : _b.content)) ? (React.createElement(LoadingDots, null)) : shouldStartTyping &&
247
248
  isTyping &&
248
249
  currentMessageIndex === 0 ? (typingMessage) : (React.createElement(ReactMarkdown, null, ((_c = messageHistory[0]) === null || _c === void 0 ? void 0 : _c.content) || '')))),
249
250
  React.createElement("div", { className: "additional-message" },
@@ -11,6 +11,7 @@ type ConsultaSimplesProps = {
11
11
  initRefinBoaVista?: boolean;
12
12
  initRefinSerasa?: boolean;
13
13
  initVeiculos?: boolean;
14
+ printMode?: boolean;
14
15
  };
15
16
  declare const ConsultaSimples: React.FC<ConsultaSimplesProps>;
16
17
  export default ConsultaSimples;
@@ -26,7 +26,7 @@ var FinderDependency = function (_a) {
26
26
  React.createElement(Queries.Protestos.Request, { data: { documento: documento }, depends: [ctxFinder] }, children)));
27
27
  };
28
28
  var ConsultaSimples = function (_a) {
29
- var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits, _b = _a.initRefinBoaVista, initRefinBoaVista = _b === void 0 ? false : _b, _c = _a.initRefinSerasa, initRefinSerasa = _c === void 0 ? false : _c, _d = _a.initVeiculos, initVeiculos = _d === void 0 ? false : _d;
29
+ var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits, _b = _a.initRefinBoaVista, initRefinBoaVista = _b === void 0 ? false : _b, _c = _a.initRefinSerasa, initRefinSerasa = _c === void 0 ? false : _c, _d = _a.initVeiculos, initVeiculos = _d === void 0 ? false : _d, _e = _a.printMode, printMode = _e === void 0 ? false : _e;
30
30
  var documento = _documento.replace(/\D+/g, '');
31
31
  return (React.createElement(ThemeProvider, { theme: theme },
32
32
  React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits, initRefinBoaVista: initRefinBoaVista, initRefinSerasa: initRefinSerasa, initVeiculos: initVeiculos },
@@ -40,7 +40,7 @@ var ConsultaSimples = function (_a) {
40
40
  React.createElement(GlobalDataProvider, null,
41
41
  React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint },
42
42
  React.createElement(ConsultaRfbProvider, { documento: documento },
43
- React.createElement(Dossie, { documento: documento }),
43
+ React.createElement(Dossie, { documento: documento, printMode: printMode }),
44
44
  React.createElement(Liminar, null),
45
45
  React.createElement(Addresses, { apiKey: apiKey }),
46
46
  React.createElement(Contacts, null),