import { useModuleDictionary as a } from "@m4l/core";
import { useFormatter as c } from "@m4l/graphics";
import { useMemo as d } from "react";
import { useDynamicFilterStore as p } from "../../store/useDynamicFilterStore.js";
import { fieldFactory as f } from "../FieldTypes/fieldFactory.js";
function D(e) {
  const { getLabel: o } = a(), t = c(), { hidePopoverFilter: r, removeFilter: n, showPopoverFilterForEdit: s } = p(
    (i) => i.actions
  ), l = d(() => f(e.field.type).getLabels(e, o, t, e.field), [e, t, o]);
  function m() {
    r(!1), n(e.id);
  }
  function u(i) {
    r(!1), setTimeout(() => s(e), 10);
  }
  return {
    onDelete: m,
    onEditFilter: u,
    iconFieldUrl: e.field?.urlIcon,
    labels: l
  };
}
export {
  D as default
};
