import { jsxs as a, Fragment as f, jsx as e } from "react/jsx-runtime";
import { useSidebarContext as h } from "../../context/sidebarContext.js";
import u from "../sidebar-row/SidebarRow.js";
import x from "../../../text/Text.js";
import g from "../../../tooltip/Tooltip.js";
import { c as n } from "../../../../index-BtlgVD4m.js";
const b = ({ label: t, isActive: s = !1, unsavedChanges: l = !1, onClick: o, as: m, asProps: c, className: d, children: p }) => {
  const { collapsed: r } = h(), i = /* @__PURE__ */ a(
    u,
    {
      isActive: s,
      as: m,
      asProps: c,
      onClick: o,
      collapsed: r,
      "aria-label": r ? t : void 0,
      className: d,
      children: [
        !r && /* @__PURE__ */ a(f, { children: [
          l && /* @__PURE__ */ e(
            "span",
            {
              "aria-label": "Unsaved changes",
              className: n("size-[var(--spacing-2)]", "shrink-0", "rounded-full", "bg-[var(--base-warning-text)]", "order-first")
            }
          ),
          /* @__PURE__ */ e("span", { className: n("flex-1", "min-w-0", "flex", "items-center", "gap-[var(--spacing-1-5)]", "text-left"), children: /* @__PURE__ */ e(x, { type: "small", truncate: !0, children: t }) })
        ] }),
        p
      ]
    }
  );
  return r ? /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(g, { content: t, side: "right", asChild: !0, children: i }) }) : /* @__PURE__ */ e("li", { children: i });
};
b.displayName = "SidebarItem";
export {
  b as default
};
//# sourceMappingURL=SidebarItem.js.map
