UNPKG

datajunction-ui

Version:
65 lines (64 loc) 2.96 kB
import { jsxs as a, jsx as e } from "react/jsx-runtime"; import { D as h, N as p } from "./index-n79cxNwC.js"; import { useState as m, useContext as N, useEffect as y } from "react"; import { useParams as g } from "react-router-dom"; function D() { const [i, r] = m([]), [c, n] = m([]), { name: s } = g(), l = N(h).DataJunctionAPI; return y(() => { (async () => { const d = await l.listNodesForTag(s), o = await l.getTag(s); r(d), n(o); })().catch(console.error); }, [l, s]), /* @__PURE__ */ a("div", { className: "mid", children: [ /* @__PURE__ */ e(p, { namespace: "" }), /* @__PURE__ */ e("div", { className: "card", children: /* @__PURE__ */ a("div", { className: "card-header", children: [ /* @__PURE__ */ e( "h3", { className: "card-title align-items-start flex-column", style: { display: "inline-block" }, children: "Tag" } ), /* @__PURE__ */ a("div", { children: [ /* @__PURE__ */ a("div", { style: { marginBottom: "1.5rem" }, children: [ /* @__PURE__ */ e("h6", { className: "mb-0 w-100", children: "Display Name" }), /* @__PURE__ */ e("p", { className: "mb-0 opacity-75", children: c.display_name }) ] }), /* @__PURE__ */ a("div", { style: { marginBottom: "1.5rem" }, children: [ /* @__PURE__ */ e("h6", { className: "mb-0 w-100", children: "Name" }), /* @__PURE__ */ e("p", { className: "mb-0 opacity-75", children: s }) ] }), /* @__PURE__ */ a("div", { style: { marginBottom: "1.5rem" }, children: [ /* @__PURE__ */ e("h6", { className: "mb-0 w-100", children: "Tag Type" }), /* @__PURE__ */ e("p", { className: "mb-0 opacity-75", children: c.tag_type }) ] }), /* @__PURE__ */ a("div", { style: { marginBottom: "1.5rem" }, children: [ /* @__PURE__ */ e("h6", { className: "mb-0 w-100", children: "Description" }), /* @__PURE__ */ e("p", { className: "mb-0 opacity-75", children: c.description }) ] }), /* @__PURE__ */ a("div", { style: { marginBottom: "1.5rem" }, children: [ /* @__PURE__ */ e("h6", { className: "mb-0 w-100", children: "Nodes" }), /* @__PURE__ */ e("div", { className: "list-group-item", children: i == null ? void 0 : i.map((t) => /* @__PURE__ */ a( "div", { className: "button-3 cube-element", role: "cell", "aria-label": "CubeElement", "aria-hidden": "false", children: [ /* @__PURE__ */ e("a", { href: `/nodes/${t.name}`, children: t.display_name }), /* @__PURE__ */ e("span", { className: `badge node_type__${t.type}`, children: t.type }) ] }, t.name )) }) ] }) ] }) ] }) }) ] }); } export { D as TagPage }; //# sourceMappingURL=index-E-natxaN.js.map