import { cn } from "./cva.js";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/Breadcrumbs.tsx
function Breadcrumbs({ items, separator = "/", className }) {
	if (items.length === 0) return null;
	return /* @__PURE__ */ jsx("nav", {
		"aria-label": "Breadcrumb",
		className: cn("flex items-center gap-1 text-sm", className),
		children: /* @__PURE__ */ jsx("ol", {
			className: "flex items-center gap-1 list-none m-0 p-0",
			children: items.map((item, index) => {
				const isLast = index === items.length - 1;
				return /* @__PURE__ */ jsxs("li", {
					className: "flex items-center gap-1",
					children: [index > 0 && /* @__PURE__ */ jsx("span", {
						className: "text-fg-muted",
						children: separator
					}), item.href ? /* @__PURE__ */ jsx("a", {
						href: item.href,
						"aria-current": isLast ? "page" : void 0,
						className: "text-fg-muted hover:text-fg transition-colors",
						children: item.label
					}) : item.onClick ? /* @__PURE__ */ jsx("button", {
						type: "button",
						onClick: item.onClick,
						"aria-current": isLast ? "page" : void 0,
						className: "text-fg-muted hover:text-fg transition-colors cursor-pointer bg-transparent border-none p-0",
						children: item.label
					}) : /* @__PURE__ */ jsx("span", {
						"aria-current": "page",
						className: "text-fg font-medium",
						children: item.label
					})]
				}, index);
			})
		})
	});
}
//#endregion
export { Breadcrumbs };
