import { StringWrapper } from "./StringWrapper.mjs";
import { useEditedContent } from "@intlayer/editor-react";
import { jsx, jsxs } from "react/jsx-runtime";
import { getContentNodeByKeyPath } from "@intlayer/core";
import { NodeType } from "@intlayer/types";

//#region src/components/DictionaryEditor/NodeWrapper/FileWrapper.tsx
const FileWrapper = (props) => {
	const { keyPath, section } = props;
	const { addEditedContent } = useEditedContent();
	const editedContentValue = getContentNodeByKeyPath(props.editedContent, keyPath);
	const subSection = section[NodeType.File];
	const { content } = section;
	const newKeyPath = [...keyPath, { type: NodeType.File }];
	return /* @__PURE__ */ jsxs("div", {
		className: "ml-2 grid grid-cols-[auto,1fr] gap-2",
		children: [/* @__PURE__ */ jsxs("span", {
			className: "text-neutral text-sm",
			children: [subSection, " "]
		}), /* @__PURE__ */ jsx(StringWrapper, {
			...props,
			keyPath: newKeyPath,
			section: content,
			editedContentValue: editedContentValue?.content,
			onContentChange: (content$1) => {
				addEditedContent(props.dictionary.localId, {
					...section,
					content: content$1.newValue
				}, keyPath);
			}
		})]
	});
};

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