/**
 * Copyright IBM Corp. 2020, 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

import { __toESM } from "../../_virtual/_rolldown/runtime.js";
import { require_classnames } from "../../node_modules/classnames/index.js";
import { pkg } from "../../settings.js";
import React from "react";
import PropTypes from "prop-types";
import { Breadcrumb, BreadcrumbItem } from "@carbon/react";

//#region src/components/AddSelect/AddSelectBreadcrumbs.jsx
var import_classnames = /* @__PURE__ */ __toESM(require_classnames());
const blockClass = `${pkg.prefix}--add-select__breadcrumbs`;
const componentName = "AddSelectBreadcrumbs";
let AddSelectBreadcrumbs = ({ multi, onClick, path }) => {
	const clickHandler = (e, idx) => {
		e.preventDefault();
		onClick(idx);
	};
	const classNames = (0, import_classnames.default)(blockClass, { [`${blockClass}-multi`]: multi });
	return /* @__PURE__ */ React.createElement(Breadcrumb, {
		noTrailingSlash: true,
		className: classNames
	}, path.map((entry, idx) => {
		const isCurrentPage = idx === path.length - 1;
		return /* @__PURE__ */ React.createElement(BreadcrumbItem, {
			key: entry.id,
			isCurrentPage,
			onClick: (e) => clickHandler(e, idx),
			href: "#"
		}, entry.title);
	}));
};
AddSelectBreadcrumbs.propTypes = {
	multi: PropTypes.bool,
	onClick: PropTypes.func,
	path: PropTypes.array
};
AddSelectBreadcrumbs.displayName = componentName;

//#endregion
export { AddSelectBreadcrumbs };