const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
require("../../index.less");
//#region src/components/productCard/components/Warning/index.tsx
const Warning = ({ errorMessage, osWarnTips }) => {
	/**
	* @title: 错误提示列表
	* @description: 错误提示列表
	* @param {*} useMemo
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-07-23 10:10
	*/
	const errorLists = (0, react.useMemo)(() => {
		if (errorMessage) {
			if (Array.isArray(errorMessage)) return errorMessage;
			if (typeof errorMessage === "string") return [errorMessage];
		}
		if ((osWarnTips === null || osWarnTips === void 0 ? void 0 : osWarnTips.length) > 0) return osWarnTips.map((item) => _pisell_utils.locales.getText(item));
		return [];
	}, [errorMessage, osWarnTips]);
	if ((errorLists === null || errorLists === void 0 ? void 0 : errorLists.length) === 0) return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null);
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, errorLists.map((item, index) => /* @__PURE__ */ react.default.createElement(antd.Alert, {
		key: index,
		message: item,
		type: "warning",
		showIcon: true,
		className: "pisell-lowcode-product-card-error"
	})));
};
//#endregion
exports.default = Warning;
