const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_JsonWrapperContext = require("./JsonWrapperContext.js");
const require_utils = require("../../utils.js");
const require_formItem = require("../../formItem.js");
let react = require("react");
react = require_runtime.__toESM(react);
//#region src/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.tsx
const JsonWrapperProvider = (props) => {
	const { children, prefix, label, style } = props;
	const { path: prefixPath = [], level = 0 } = (0, react.useContext)(require_JsonWrapperContext.default) || {};
	const concatPath = (0, react.useMemo)(() => [...prefixPath, ...require_utils.toArr(prefix)], [prefixPath, prefix]);
	const contextValue = (0, react.useMemo)(() => ({
		path: concatPath,
		level: level + 1
	}), [concatPath, level]);
	return /* @__PURE__ */ react.default.createElement(require_JsonWrapperContext.default.Provider, { value: contextValue }, /* @__PURE__ */ react.default.createElement(require_formItem.default, {
		label,
		style: require_objectSpread2._objectSpread2({ marginBottom: 0 }, style || {})
	}, /* @__PURE__ */ react.default.createElement("div", null, children)));
};
//#endregion
exports.default = JsonWrapperProvider;
