import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { withWrap } from "../../utils/hoc.js";
import React, { useEffect } from "react";
import { Badge } from "antd";
import "./index.less";
//#region src/components/badge/index.tsx
const Badge$1 = withWrap((props) => {
	const { styleType = "", color = "" } = props;
	let state = props;
	useEffect(() => {
		document.body.id = "body";
	}, []);
	const formatColor = (color = "") => {
		let newColor = color;
		if (styleType === "default") newColor = "#f6f7f9";
		else if (styleType === "warning") newColor = "#D92D20";
		return newColor;
	};
	const BadgeProps = _objectSpread2(_objectSpread2({}, state), {}, {
		className: "pisell-badge-wrap",
		color: formatColor(color)
	});
	return /* @__PURE__ */ React.createElement(Badge, _objectSpread2(_objectSpread2({}, BadgeProps), {}, { style: {
		borderColor: styleType === "default" ? "#e7e9ed" : state.color,
		color: styleType === "default" ? "#344054" : "#fff"
	} }));
});
//#endregion
export { Badge$1 as default };
