@leapdevuk/component-toolbox 0.1.6 → 0.1.7

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.
package/dist/index.es.js CHANGED
@@ -5076,8 +5076,13 @@ class kc extends Ds {
5076
5076
  }
5077
5077
  render() {
5078
5078
  if (this.state.hasError) {
5079
- const { fallback: t } = this.props;
5080
- return t !== void 0 ? typeof t == "function" ? t(this.state.error) : t : /* @__PURE__ */ l.jsx(
5079
+ const { fallback: t } = this.props, { error: n } = this.state, o = n ? n.message.slice(0, n.message.indexOf(".") + 1) || n.message : void 0;
5080
+ return t !== void 0 ? typeof t == "function" ? t(
5081
+ n && Object.assign(new Error(o), {
5082
+ name: n.name,
5083
+ stack: n.stack
5084
+ })
5085
+ ) : t : /* @__PURE__ */ l.jsx(
5081
5086
  Mc,
5082
5087
  {
5083
5088
  sx: {
@@ -5089,12 +5094,12 @@ class kc extends Ds {
5089
5094
  },
5090
5095
  children: /* @__PURE__ */ l.jsx(_c, { severity: "error", sx: { width: "-webkit-fill-available" }, children: /* @__PURE__ */ l.jsxs(go, { color: "#5f2120", sx: { fontSize: 14 }, children: [
5091
5096
  "Unable to display UI component. Please refresh the page or contact LEAP if the problem persists.",
5092
- this.state.error && /* @__PURE__ */ l.jsx(
5097
+ n && /* @__PURE__ */ l.jsx(
5093
5098
  go,
5094
5099
  {
5095
5100
  color: "default",
5096
5101
  sx: { fontSize: 12, marginTop: 0.5, opacity: 0.8 },
5097
- children: this.state.error.message
5102
+ children: o
5098
5103
  }
5099
5104
  )
5100
5105
  ] }) })