@glodon-aiot/react-components
Version:
aiot react components
70 lines (69 loc) • 2 kB
JavaScript
var x = Object.defineProperty, f = Object.defineProperties;
var h = Object.getOwnPropertyDescriptors;
var t = Object.getOwnPropertySymbols;
var g = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable;
var w = (e, o, a) => o in e ? x(e, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[o] = a, d = (e, o) => {
for (var a in o || (o = {}))
g.call(o, a) && w(e, a, o[a]);
if (t)
for (var a of t(o))
p.call(o, a) && w(e, a, o[a]);
return e;
}, m = (e, o) => f(e, h(o));
var u = (e, o) => {
var a = {};
for (var n in e)
g.call(e, n) && o.indexOf(n) < 0 && (a[n] = e[n]);
if (e != null && t)
for (var n of t(e))
o.indexOf(n) < 0 && p.call(e, n) && (a[n] = e[n]);
return a;
};
import { jsxs as k, jsx as r } from "react/jsx-runtime";
import { Prism as N } from "react-syntax-highlighter";
import { Copy as v } from "../../Copy/index.mjs";
import { Space as C } from "antd";
const L = (S) => {
var i = S, {
node: e,
inline: o,
className: a,
children: n
} = i, s = u(i, [
"node",
"inline",
"className",
"children"
]);
const l = /language-(\w+)/.exec(a || ""), c = l ? l[1] : null;
return !o && c ? /* @__PURE__ */ k("div", {
className: "markdown-code",
children: [/* @__PURE__ */ k("div", {
className: "markdown-code-title",
children: [/* @__PURE__ */ r("span", {
className: "markdown-code-title-text",
children: c
}), /* @__PURE__ */ r(C, {
className: "markdown-code-title-action",
children: /* @__PURE__ */ r(v, {
text: String(n)
})
})]
}), /* @__PURE__ */ r(N, m(d({
className: "markdown-code-context",
language: c
}, s), {
wrapLongLines: !0,
showLineNumbers: !0,
PreTag: "div",
children: String(n).replace(/\n$/, "")
}))]
}) : /* @__PURE__ */ r("code", m(d({
className: a
}, s), {
children: n
}));
}, y = L;
export {
y as default
};