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");
const require_index = require("../../modal/index.js");
const require_index$1 = require("../../icon/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/pisellToast/squareToast/toast.tsx
const _excluded = [
	"content",
	"open",
	"icon",
	"className"
];
const icons = {
	info: "",
	success: "iconchenggong-1-01",
	error: "icon-warning",
	warning: "icon-warning",
	loading: "icon-loading",
	fail: "icon-warning"
};
const Toast = (_ref) => {
	let { content, open, icon, className } = _ref, rest = require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
	const iconElement = (0, react.useMemo)(() => {
		if (icon === null || icon === void 0) return null;
		if (typeof icon === "string" && icon in icons) {
			if (!icons[icon]) return null;
			return /* @__PURE__ */ react.default.createElement(require_index$1.default, {
				type: icons[icon],
				className: `pisell-square-toast-icon pisell-square-toast-icon-${icon}`
			});
		}
		return icon;
	}, [icon]);
	return /* @__PURE__ */ react.default.createElement(require_index.default, require_objectSpread2._objectSpread2({
		open,
		footer: null,
		closable: false,
		centered: true,
		maskTransitionName: "",
		transitionName: "",
		width: "unset",
		wrapClassName: "pisell-square-toast-wrap",
		className: (0, classnames.default)("pisell-square-toast-modal", className),
		bodyStyle: { padding: 0 },
		destroyOnClose: true,
		modalRender: () => /* @__PURE__ */ react.default.createElement("div", { className: `pisell-square-toast` }, iconElement && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-square-toast-icon-wrapper" }, iconElement), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-square-toast-content" }, content))
	}, rest));
};
//#endregion
exports.default = Toast;
