import { jsx as C, jsxs as l } from "react/jsx-runtime";
import { useCallback as O, useMemo as f, Fragment as i } from "react";
import { d as x, c as A } from "../../../../CommandPrimitive-DexRxw-2.js";
import { COMMAND_VARIANT as c } from "../../constants/index.js";
import M from "../../../checkbox/components/checkbox-group/CheckboxGroup.js";
import b from "../command-item/CommandItem.js";
const G = ({ groups: n, inputValue: a, checkboxValue: p, onItemSelect: r, variant: o, renderItem: d }) => {
  const e = O(
    (m) => {
      r(m);
    },
    [r]
  ), s = f(() => o === c.CHECKBOX ? M : i, [o]);
  return f(
    () => /* @__PURE__ */ C(s, { ...o === c.CHECKBOX && { value: p, onChange: e }, children: n.map((m, h) => /* @__PURE__ */ l(i, { children: [
      h > 0 && /* @__PURE__ */ C(x, {}),
      /* @__PURE__ */ C(A, { heading: m.heading, children: m.items.map((t) => /* @__PURE__ */ C(
        b,
        {
          item: t,
          variant: o,
          inputValue: a,
          onItemSelect: r,
          renderItem: d
        },
        t.value
      )) })
    ] }, `group-${m.heading}-${h}`)) }),
    [n, s, p, e, o, a, r, d]
  );
};
export {
  G as default
};
//# sourceMappingURL=CommandContent.js.map
