import { jsx as n, jsxs as u } from "react/jsx-runtime";
import { Icon as y } from "./index-Icon.js";
import { Text as I, TextTypes as g } from "./index-Text.js";
import "react";
import v from "./index-MenuItem2.js";
const M = ({
  testId: f,
  className: a,
  children: e,
  textType: m = g.text,
  icon: t,
  iconProps: d,
  iconPosition: o = "before",
  useActiveIcon: i = !1,
  ...s
}) => {
  const c = typeof e == "string" ? n(I, {
    type: m,
    children: e
  }) : e, p = s.selected, l = t && i ? `${t}-active` : t, r = l ? n(y, {
    color: p ? "var(--fn-fg-cta)" : void 0,
    ...d,
    children: l
  }) : null, x = r ? u("div", {
    style: {
      display: "flex",
      alignItems: "center",
      width: "100%",
      gap: 8,
      justifyContent: o === "after" ? "space-between" : "flex-start"
    },
    children: [o === "before" && r, c, o === "after" && r]
  }) : c;
  return n(v, {
    "data-testid": f,
    className: a,
    ...s,
    children: x
  });
};
export {
  M as MenuItem
};
