@airplane/views
Version:
A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.
25 lines (24 loc) • 1.15 kB
JavaScript
import { jsxs, jsx } from "react/jsx-runtime";
import { CodeComponent } from "../code/Code.js";
import { HeadingComponent } from "../heading/Heading.js";
import { StackComponent } from "../stack/Stack.js";
const ErrorStackTrace = ({
error,
errorInfo
}) => {
return /* @__PURE__ */ jsxs(StackComponent, { children: [
/* @__PURE__ */ jsx(CodeComponent, { language: "none", copyLabel: "Copy error", children: error.message }),
error.stack && /* @__PURE__ */ jsxs(StackComponent, { spacing: "sm", children: [
/* @__PURE__ */ jsx(HeadingComponent, { level: 5, children: "Stack trace" }),
/* @__PURE__ */ jsx(CodeComponent, { language: "none", copyLabel: "Copy stack trace", children: error.stack })
] }),
errorInfo.componentStack && /* @__PURE__ */ jsxs(StackComponent, { spacing: "sm", children: [
/* @__PURE__ */ jsx(HeadingComponent, { level: 5, children: "Component stack trace" }),
/* @__PURE__ */ jsx(CodeComponent, { language: "none", copyLabel: "Copy stack trace", children: errorInfo.componentStack })
] })
] });
};
export {
ErrorStackTrace
};
//# sourceMappingURL=ErrorStackTrace.js.map