import { jsx as r, jsxs as p } from "react/jsx-runtime";
import { useCallback as s, useMemo as c } from "react";
import i from "../../../../../jtl-dropdown/types/DropdownItem.js";
import u from "../../../../../jtl-dropdown/JTLDropdown.js";
import b from "../../../../../text/Text.js";
import f from "../../../../../icon/Icon.js";
const C = ({
  condition: o,
  conditionIndex: a,
  columns: t,
  onColumnChange: n
}) => {
  const l = s(() => t.map((e) => ({
    type: i.Default,
    label: e.title,
    onClick: () => n(a, e.dataIndex)
  })), [t, n, a]), m = c(() => {
    const e = t.find((d) => d.dataIndex === o.column.dataIndex);
    return e ? e.title : "Select column";
  }, [t, o.column.dataIndex]);
  return /* @__PURE__ */ r(u, { menuItems: l(), position: "left", width: "160px", children: /* @__PURE__ */ p(
    "button",
    {
      type: "button",
      className: "flex items-center border border-[var(--base-border)] gap-2 px-4 h-[var(--height-h-10)] rounded-md w-[160px] hover:bg-[var(--base-accent)] bg-transparent cursor-pointer",
      children: [
        /* @__PURE__ */ r(b, { type: "small", weight: "regular", truncate: !0, children: m }),
        /* @__PURE__ */ r(f, { name: "ChevronDown" })
      ]
    }
  ) });
};
export {
  C as default
};
//# sourceMappingURL=AdvancedFilterColumnSelector.js.map
