@graphiql/plugin-doc-explorer
Version:
43 lines (42 loc) • 905 B
JavaScript
import { jsx } from "react/jsx-runtime";
import { c } from "react-compiler-runtime";
import { useDocExplorerActions } from "../context.js";
import { renderType } from "./utils.js";
/* empty css */
const TypeLink = (t0) => {
const $ = c(5);
const {
type
} = t0;
const {
push
} = useDocExplorerActions();
let t1;
if ($[0] !== push) {
t1 = (def) => /* @__PURE__ */ jsx("a", { className: "graphiql-doc-explorer-type-name", onClick: (event) => {
event.preventDefault();
push({
name: def.name,
def
});
}, href: "#", children: def.name });
$[0] = push;
$[1] = t1;
} else {
t1 = $[1];
}
let t2;
if ($[2] !== t1 || $[3] !== type) {
t2 = renderType(type, t1);
$[2] = t1;
$[3] = type;
$[4] = t2;
} else {
t2 = $[4];
}
return t2;
};
export {
TypeLink
};
//# sourceMappingURL=type-link.js.map