UNPKG

@graphiql/plugin-doc-explorer

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