const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_objectWithoutProperties = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
//#region src/components/PisellCards/components/TextCard/components/BadgeWrapper.tsx
const _excluded = [
	"type",
	"content",
	"offset",
	"size",
	"color",
	"style",
	"showZero"
];
/**
* BadgeWrapper 角标包装组件
* 负责角标的渲染和定位，支持红点、数字、文本三种类型
* 位置通过 offset 控制，大小通过 size 控制
*
* @example
* ```tsx
* // 红点角标
* <BadgeWrapper badge={{ type: 'dot' }}>
*   <TextCard text="Item" />
* </BadgeWrapper>
*
* // 数字角标
* <BadgeWrapper badge={{ type: 'number', content: 99 }}>
*   <TextCard text="Item" />
* </BadgeWrapper>
*
* // 文本角标
* <BadgeWrapper badge={{ type: 'text', content: 'New' }}>
*   <TextCard text="Item" />
* </BadgeWrapper>
* ```
*/
const BadgeWrapper = (props) => {
	const { badge, children } = props;
	if (!badge) return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, children);
	const { type = "dot", content, offset, size, color, style, showZero = false } = badge, rest = require_objectWithoutProperties._objectWithoutProperties(badge, _excluded);
	/**
	* 根据角标类型渲染不同的 Badge
	*/
	const renderBadge = () => {
		if (type === "dot") return /* @__PURE__ */ react.default.createElement(antd.Badge, require_objectSpread2._objectSpread2({
			dot: true,
			color,
			offset,
			size,
			style
		}, rest), children);
		if (type === "number" || type === "text") return /* @__PURE__ */ react.default.createElement(antd.Badge, require_objectSpread2._objectSpread2({
			count: content,
			color,
			offset,
			size,
			style,
			showZero
		}, rest), children);
		return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, children);
	};
	return renderBadge();
};
//#endregion
exports.default = BadgeWrapper;
