UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

52 lines (51 loc) 1.28 kB
import { jsxs as h, jsx as c, Fragment as x } from "react/jsx-runtime"; import { merge as b } from "lodash-es"; import { useCallback as k, useMemo as y } from "react"; import a from "./IconSvg/IconSvg.js"; import { useQueryContext as S } from "./QueryContext/QueryContext.js"; const j = { sx: { fontSize: "24px" } }; function M(f) { const { iconConfigs: s, iconNames: l, commonIconProps: r = j, useTheme: d, useBackground: p } = f; let i = !1; const m = d ? "icon-list themed" : "icon-list", g = p ? `${m} bg-circle` : m, C = S(), { addValueToSelectedFacet: u } = C, I = k( (n) => { u({ columnName: "dataType" }, n); }, [u] ), t = y(() => { const n = {}; for (const [o, e] of Object.entries(s)) n[o] = b({}, r, e); return n; }, [s, r]); return /* @__PURE__ */ h("span", { className: g, children: [ Array.from(new Set(l)).map((o) => { const e = t[o]; if (e) return /* @__PURE__ */ c( a, { ...e, onClick: () => I(o) }, o ); i = !0; }), i && t.other ? /* @__PURE__ */ c(a, { ...t.other }) : /* @__PURE__ */ c(x, {}) ] }); } export { M as default }; //# sourceMappingURL=IconList.js.map