@credithub/harlan-components 1.95.4 → 1.95.5

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.
@@ -41,13 +41,14 @@ var GraficosAnaliticosDependency = function (_a) {
41
41
  };
42
42
  var HasCreditsVerification = function (_a) {
43
43
  var children = _a.children, documento = _a.documento, apiKey = _a.apiKey;
44
- var _b = useQuery("SELECT FROM 'HARLANCREDITS'.'HASCREDITS'", { documento: documento }), response = _b.response, error = _b.error, isLoading = _b.isLoading;
45
- var _c = useToggle(true), isOpen = _c[0], toggle = _c[1];
46
- if (isLoading || error)
47
- return React.createElement(React.Fragment, null);
48
- if (response === null || response === void 0 ? void 0 : response.document) {
44
+ var response = useQuery("SELECT FROM 'HARLANCREDITS'.'HASCREDITS'", { documento: documento }).response;
45
+ var _b = useToggle(true), isOpen = _b[0], toggle = _b[1];
46
+ // Se não houver resposta ainda ou se a consulta retornar "tem créditos",
47
+ // libera os filhos normalmente (não desmonta nada).
48
+ if (!response || response.document) {
49
49
  return React.createElement(React.Fragment, null, children);
50
50
  }
51
+ // Caso a resposta indique ausência de créditos, mostra o modal.
51
52
  return (React.createElement(Modal, { isOpen: isOpen, onClose: toggle, title: "Aten\u00E7\u00E3o: Voc\u00EA precisa de cr\u00E9ditos!", footer: null },
52
53
  React.createElement("p", { style: { fontSize: 18 } },
53
54
  "Voc\u00EA n\u00E3o possui cr\u00E9ditos para realizar esta consulta.",