import { jsxs as i } from "react/jsx-runtime";
import { useRef as F, createElement as E } from "react";
import { useBreadcrumbItem as N } from "@react-aria/breadcrumbs";
import { useFocusRing as T } from "@react-aria/focus";
import { mergeProps as B } from "@react-aria/utils";
import { getItemElementType as P } from "../../utilities/elements.es.js";
import { FOCUS_STYLE_NO_OFFSET as C } from "../../utilities/focusStyle.es.js";
import { merge as p } from "../../utilities/merge.es.js";
import { Badge as I } from "../Badge/Badge.es.js";
const O = ({
  label: r,
  badges: t,
  bold: c,
  decorator: a,
  link: m,
  onClick: o,
  activeInline: s,
  "data-test-id": u = "breadcrumb"
}) => {
  const n = F(null), e = P(m, o), { itemProps: l } = N(
    {
      isCurrent: !0,
      children: r,
      elementType: e
    },
    n
  ), w = { a: { href: m }, button: { onClick: o, type: "button" }, span: {} }, { isFocusVisible: d, focusProps: f } = T(), x = B(l, f, w[e]), b = p([
    "tw-flex tw-gap-x-1 tw-items-center tw-leading-4 tw-h-6 tw-whitespace-pre-wrap tw-font-medium tw-rounded",
    c && "tw-font-bold",
    s && "tw-text-xs",
    d && C
  ]);
  return /* @__PURE__ */ i(
    "li",
    {
      className: p([
        "tw-align-middle tw-gap-x-1 tw-text-m tw-text-text tw-items-center",
        s ? "tw-flex tw-items-center" : "tw-w-full tw-inline-flex"
      ]),
      "data-test-id": `${u}-item`,
      children: [
        /* @__PURE__ */ i(e, { ref: n, ...x, className: b, children: [
          a,
          r
        ] }),
        t == null ? void 0 : t.map(({ children: h, ...g }, y) => /* @__PURE__ */ E(I, { ...g, key: `breadcrumb-badge-${y}` }, h))
      ]
    }
  );
};
O.displayName = "FondueCurrentBreadcrumbItem";
export {
  O as CurrentBreadcrumbItem
};
//# sourceMappingURL=CurrentBreadcrumbItem.es.js.map
