import { jsx as e, Fragment as g } from "react/jsx-runtime";
import { noop as h } from "es-toolkit/function";
import C from "../../utils/classNames.js";
import u from "../overlay/OverlayTrigger.js";
import s from "../tooltip/Tooltip.js";
const y = "active", S = "selected", f = 1500, _ = (l) => {
  const { children: r, currentCategoryId: c, onSelectCategory: i = h } = l;
  return r ? /* @__PURE__ */ e(g, { children: r.map((o) => {
    const t = o.props.id, p = o.props.icon || "", a = o.props.label, m = C(
      c === t ? y : "",
      o.props.hasSelection && S
    ), n = /* @__PURE__ */ e("li", { onClick: (d) => {
      d.stopPropagation(), i(t);
    }, className: m, children: /* @__PURE__ */ e("div", { className: "selection-bubble", children: /* @__PURE__ */ e("span", { className: `rioglyph ${p}` }) }) }, t);
    return a ? /* @__PURE__ */ e(
      u,
      {
        placement: s.RIGHT,
        delay: { show: f, hide: 0 },
        overlay: /* @__PURE__ */ e(s, { id: "tooltip", width: "auto", children: /* @__PURE__ */ e("span", { children: a }) }),
        children: n
      },
      `category-tooltip-${t}`
    ) : n;
  }) }) : null;
};
export {
  _ as default
};
//# sourceMappingURL=TreeSidebarCategories.js.map
