import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import React, { useMemo } from "react";
//#region src/components/div/index.tsx
const _excluded = [
	"baseClassName",
	"className",
	"render",
	"children",
	"style",
	"others"
];
const Div = (props) => {
	const { baseClassName = "div", className = "", render, children, style = {}, others = {} } = props, otherProps = _objectWithoutProperties(props, _excluded);
	const combinedClassName = useMemo(() => {
		const parts = [baseClassName, className].filter(Boolean);
		return parts.length > 0 ? parts.join(" ") : void 0;
	}, [baseClassName, className]);
	const content = useMemo(() => {
		if (render) try {
			return render();
		} catch (error) {
			console.error("Div render function error:", error);
			return children;
		}
		return children;
	}, [render, children]);
	const divProps = useMemo(() => _objectSpread2(_objectSpread2(_objectSpread2({}, combinedClassName && { className: combinedClassName }), {}, { style }, others), otherProps), [
		combinedClassName,
		style,
		others,
		otherProps
	]);
	return /* @__PURE__ */ React.createElement("div", divProps, content);
};
Div.displayName = "Div";
var div_default = React.memo(Div);
//#endregion
export { div_default as default };
