import { Breadcrumb } from "../Breadcrumb/index.mjs";
import { jsx } from "react/jsx-runtime";
import { camelCaseToSentence } from "@intlayer/config/client";

//#region src/components/DictionaryFieldEditor/KeyPathBreadcrumb.tsx
const KeyPathBreadcrumb = ({ keyPath, dictionaryKey, onClickKeyPath, locale }) => {
	return /* @__PURE__ */ jsx(Breadcrumb, {
		links: [{
			text: camelCaseToSentence(dictionaryKey),
			onClick: () => onClickKeyPath([])
		}, ...keyPath.map((el, index) => ({
			onClick: () => onClickKeyPath(keyPath.slice(0, index + 1)),
			text: el.key?.toString() ?? ""
		}))],
		locale,
		elementType: "location"
	});
};

//#endregion
export { KeyPathBreadcrumb };
//# sourceMappingURL=KeyPathBreadcrumb.mjs.map