/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-a795c5b | Cube Dev Team */
import { isValidElement } from "react";
import { isFragment } from "react-is";

//#region src/utils/react/wrapNodeIfPlain.ts
function wrapNodeIfPlain(children, render) {
	const childrenIsFragment = children && (Array.isArray(children) || isFragment(children));
	if (!children || !childrenIsFragment && isValidElement(children)) return children;
	return render();
}

//#endregion
export { wrapNodeIfPlain };
//# sourceMappingURL=wrapNodeIfPlain.js.map