import { jsx as a, jsxs as h } from "react/jsx-runtime";
import { useCallback as l } from "react";
import e, { operatorTextObject as b, operatorShortcutObject as c } from "../../types/FilterConditionOperator.js";
import f from "../../../../../jtl-dropdown/types/DropdownItem.js";
import n from "../../../../../jtl-dropdown/JTLDropdown.js";
import O from "../../../../../text/Text.js";
import T from "../../../../../icon/Icon.js";
const C = ({
  condition: m,
  conditionIndex: o,
  onOperatorChange: s
}) => {
  const t = l(
    (r, p) => ({
      type: f.Default,
      shortcut: c[r],
      label: b[r],
      onClick: () => s(p, r)
    }),
    [s]
  ), u = l(
    (r) => [
      t(e.Equals, r),
      t(e.NotEquals, r),
      t(e.GreaterThan, r),
      t(e.GreaterThanOrEqual, r),
      t(e.LessThan, r),
      t(e.LessThanOrEqual, r),
      t(e.Contains, r),
      t(e.StartsWith, r),
      t(e.EndsWith, r),
      t(e.In, r)
    ],
    [t]
  );
  return /* @__PURE__ */ a(n, { menuItems: u(o), position: "left", width: "240px", children: /* @__PURE__ */ h(
    "button",
    {
      type: "button",
      className: "flex items-center border border-[var(--base-border)] gap-2 px-4 h-[var(--height-h-10)] rounded-md w-[240px] hover:bg-[var(--base-accent)] bg-transparent cursor-pointer",
      children: [
        /* @__PURE__ */ a(O, { type: "small", weight: "regular", truncate: !0, children: t(m.operator, o).label }),
        /* @__PURE__ */ a(T, { name: "ChevronDown" })
      ]
    }
  ) });
};
export {
  C as default
};
//# sourceMappingURL=AdvancedFilterOperatorSelector.js.map
