@credithub/harlan-components 1.91.8 → 1.91.9

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.
@@ -1,4 +1,3 @@
1
- // No arquivo section.tsx
2
1
  var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
2
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
3
  return cooked;
@@ -40,13 +39,16 @@ import StatusMessage from './interface/statusMessage';
40
39
  import { RequestStatus } from './webservice';
41
40
  var ButtonWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n justify-content: center;\n width: 100%;\n height: 40%;\n max-height: 52px;\n max-width: 300px;\n margin: 0 auto;\n"], ["\n justify-content: center;\n width: 100%;\n height: 40%;\n max-height: 52px;\n max-width: 300px;\n margin: 0 auto;\n"])));
42
41
  var Section = forwardRef(function (_a, ref) {
43
- var onSuccess = _a.onSuccess, _b = _a.isError, isError = _b === void 0 ? function (err, ctx) { return ({
44
- children: React.createElement(React.Fragment, null),
45
- description: (React.createElement(React.Fragment, null,
46
- React.createElement(StatusMessage, { type: "error" }, err.message))),
47
- actions: (React.createElement(React.Fragment, null, (ctx === null || ctx === void 0 ? void 0 : ctx.refetch) && (React.createElement(ButtonWrapper, null,
48
- React.createElement(Button, { onClick: function () { return ctx.refetch(); } }, "Tentar Novamente")))))
49
- }); } : _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"]);
42
+ var onSuccess = _a.onSuccess, _b = _a.isError, isError = _b === void 0 ? function (err, ctx) {
43
+ var shouldPush = (err === null || err === void 0 ? void 0 : err.push) === true;
44
+ return {
45
+ children: React.createElement(React.Fragment, null),
46
+ description: shouldPush ? (React.createElement(React.Fragment, null,
47
+ React.createElement(StatusMessage, { type: "error" }, err.message))) : null,
48
+ actions: (React.createElement(React.Fragment, null, (ctx === null || ctx === void 0 ? void 0 : ctx.refetch) && (React.createElement(ButtonWrapper, null,
49
+ React.createElement(Button, { onClick: function () { return ctx.refetch(); } }, "Tentar Novamente")))))
50
+ };
51
+ } : _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"]);
50
52
  var _f = useToggle(!minimized), isOpen = _f[0], toggleOpen = _f[1];
51
53
  if (!ctx)
52
54
  return null;