@credithub/harlan-components 1.22.1 → 1.22.2

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.
@@ -14,26 +14,22 @@ import styled from 'styled-components';
14
14
  import { useConsultaRfb } from '../../hooks/useConsultaRfb';
15
15
  var DossieContent = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr 2fr;\n justify-items: center;\n align-items: flex-start;\n margin-bottom: 20px;\n gap: 20px;\n\n @media screen and (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n"], ["\n display: grid;\n grid-template-columns: 1fr 2fr;\n justify-items: center;\n align-items: flex-start;\n margin-bottom: 20px;\n gap: 20px;\n\n @media screen and (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n"])));
16
16
  var DossieContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0px 70px;\n\n @media (max-width: 1000px) {\n padding: 0px 30px;\n }\n"], ["\n padding: 0px 70px;\n\n @media (max-width: 1000px) {\n padding: 0px 30px;\n }\n"])));
17
- var useDossieData = function (documento, rfbResponse) {
18
- var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
19
- var name = isPF
20
- ? XPathUtils.select('string(//cadastro/nome)', rfbResponse)
21
- : XPathUtils.select('string(//cadastro/razaoSocial)', rfbResponse) ||
22
- (rfbResponse && XPathUtils.select('string(//RFB/nome)', rfbResponse));
23
- var document = isPF ? formatCpf(documento) : formatCnpj(documento);
24
- return { isPF: isPF, name: name, document: document };
25
- };
26
17
  var Dossie = function (_a) {
27
18
  var documento = _a.documento;
28
19
  var finderCtx = useContext(Queries.Finder);
29
20
  var rfbResponse = useConsultaRfb().rfbResponse;
30
21
  var Section = finderCtx.Section;
31
- var _b = useDossieData(documento, rfbResponse), isPF = _b.isPF, name = _b.name, document = _b.document;
32
- var DossieCarrousel = function () {
33
- return !isPF ? (React.createElement(ReclameAquiCarousel, { documento: document, nome: name })) : (React.createElement(Carrousel, { name: name, document: document }));
34
- };
35
22
  var response = function (_data) {
36
23
  var data = _data instanceof Error ? undefined : _data;
24
+ var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
25
+ var name = (isPF
26
+ ? XPathUtils.select('string(//cadastro/nome)', data)
27
+ : XPathUtils.select('string(//cadastro/razaoSocial)', data) ||
28
+ (rfbResponse && XPathUtils.select('string(//RFB/nome)', rfbResponse)));
29
+ var document = isPF ? formatCpf(documento) : formatCnpj(documento);
30
+ var DossieCarrousel = function () {
31
+ return !isPF ? (React.createElement(ReclameAquiCarousel, { documento: document, nome: name })) : (React.createElement(Carrousel, { name: name, document: document }));
32
+ };
37
33
  return (React.createElement(DossieContainer, null,
38
34
  React.createElement(DossieContent, null,
39
35
  React.createElement(DossieCarrousel, null),