import { jsxs as v, jsx as t } from "react/jsx-runtime";
import { forwardRef as x, useRef as N } from "react";
import { noop as R } from "es-toolkit/function";
import i from "../../utils/classNames.js";
import k from "../../hooks/useHover.js";
import w from "../../utils/mergeRefs.js";
import { withRioglyphPrefix as T } from "./treeUtils.js";
const O = x((a, c) => {
  const {
    icon: m,
    value: o,
    isActive: e,
    hasFilter: p = !1,
    enableActivity: s = !1,
    onClick: f = R,
    type: l,
    hideOnZero: d = !1,
    ...u
  } = a, n = N(null), g = w([c, n]), r = k(n), h = i(
    "TypeCounter",
    "display-flex align-items-center",
    "user-select-none",
    "margin-right-2",
    s ? "cursor-pointer" : "pointer-events-none",
    s && p && !e && !r && "opacity-50"
  ), y = i(
    "TreeLabelCount",
    "label label-condensed",
    r && !e && "bg-white text-color-darker",
    r && !e && "border-color-gray",
    r && e && "border-color-primary",
    e ? "label-primary" : "label-muted label-filled"
  ), b = () => l && f(l);
  if (d && !o)
    return null;
  const C = T(m);
  return /* @__PURE__ */ v("div", { ref: g, ...u, className: h, onClick: b, children: [
    /* @__PURE__ */ t("span", { className: `rioglyph ${C} text-size-16 margin-right-2` }),
    /* @__PURE__ */ t("span", { className: y, children: o || 0 })
  ] });
});
export {
  O as default
};
//# sourceMappingURL=TypeCounter.js.map
