UNPKG

@flanksource/clicky-ui

Version:

Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.

27 lines (26 loc) 1.93 kB
import { jsx, jsxs, Fragment } from "react/jsx-runtime"; import { Icon } from "../Icon.js"; function JvmStackTrace({ frames, hideRuntimeOnly = false, className }) { const visibleFrames = hideRuntimeOnly ? frames.filter((frame) => frame.kind !== "frame" || !frame.runtime) : frames; if (visibleFrames.length === 0) return null; return /* @__PURE__ */ jsx("div", { className, children: visibleFrames.map((frame, index) => /* @__PURE__ */ jsx(JvmStackFrameRow, { frame }, `${frame.functionName}-${index}`)) }); } function JvmStackFrameRow({ frame }) { const isAnno = frame.kind !== "frame"; const iconName = isAnno ? frame.kind === "locked" ? "codicon:lock" : frame.kind === "waiting_to_lock" ? "codicon:sync" : "codicon:watch" : frame.nativeMethod ? "codicon:chip" : frame.runtime ? "codicon:debug-step-over" : "codicon:symbol-method"; return /* @__PURE__ */ jsx("div", { className: frame.runtime ? "text-muted-foreground" : "text-foreground", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1.5", children: [ /* @__PURE__ */ jsx(Icon, { name: iconName, className: "mt-0.5 shrink-0 text-[11px]" }), /* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx("div", { className: "break-all font-mono text-[11px] font-semibold leading-4", children: isAnno ? /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx("span", { className: "opacity-70", children: frame.functionName }), frame.annotationText && /* @__PURE__ */ jsx("span", { className: "ml-2 font-normal opacity-80", children: frame.annotationText }) ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [ frame.displayName, frame.location && /* @__PURE__ */ jsx("span", { className: "ml-2 text-[10px] font-normal opacity-80", children: frame.location }) ] }) }) }) ] }) }); } export { JvmStackFrameRow, JvmStackTrace }; //# sourceMappingURL=JvmStackTrace.js.map