import { useI18n as p } from "@feedmepos/mf-common";
import { components as d } from "@feedmepos/ui-library";
import { h as t } from "vue";
const { FmMenu: b, FmButton: f, FmMenuItem: u, FmMenuHeader: g, FmMenuDivider: C } = d;
function F(c, l, a = []) {
  const { t: s } = p(), i = [
    ...c.map(({ translationKey: n, color: o, value: r, badgeWidget: e }) => {
      const m = s(n);
      return t(
        u,
        {
          onClick() {
            l(r ?? m);
          }
        },
        {
          label: () => t(
            "div",
            {
              class: "flex items-center gap-2"
            },
            [
              t(
                "span",
                {
                  class: o
                },
                m
              ),
              e ? e() : null
            ]
          )
        }
      );
    })
  ];
  return a.length > 0 && i.push(
    t(g, { label: "Admin Only" }),
    t(C),
    ...a.map(({ translationKey: n, color: o, value: r }) => {
      const e = s(n);
      return t(
        u,
        {
          onClick() {
            l(r ?? e);
          },
          icon: "support_agent"
        },
        {
          label: () => t(
            "span",
            {
              class: o
            },
            e
          )
        }
      );
    })
  ), t(
    b,
    {
      trigger: "click",
      stopClickPropagation: !0
    },
    {
      "menu-button": () => t(f, {
        type: "button",
        variant: "tertiary",
        icon: "more_vert",
        iconColor: "#000000",
        size: "md"
      }),
      default: () => t(
        "div",
        {
          style: {
            backgroundColor: "white",
            padding: "4px",
            width: "160px"
          }
        },
        i
      )
    }
  );
}
export {
  F as c
};
