const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../iconfont/index.js");
const require_index$1 = require("../pisellMessage/index.js");
require("./squareToast/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
require("./index.less");
//#region src/components/pisellToast/index.tsx
const PisellToast = (props) => {
	const { content, duration, showAction, actionText, onClose } = props;
	const key = (0, _pisell_utils.getUniqueId)();
	if (!require_index$1.message) return alert(content);
	require_index$1.message.open({
		key,
		content: /* @__PURE__ */ react.default.createElement("div", { className: "pisell-toast-content" }, /* @__PURE__ */ react.default.createElement("span", null, content), showAction && /* @__PURE__ */ react.default.createElement("span", { className: "pisell-toast-action" }, actionText), /* @__PURE__ */ react.default.createElement(require_index.default, {
			type: "pisell2-x-close",
			className: "pisell-toast-close",
			onClick: () => require_index$1.message.destroy(key)
		})),
		icon: null,
		duration: duration || 5,
		className: "pisell-toast-wrap",
		onClose
	});
};
//#endregion
exports.default = PisellToast;
