const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_constants = require("../../constants.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_materials = require("@pisell/materials");
let _ant_design_icons = require("@ant-design/icons");
require("./index.less");
//#region src/plus/saasDevice/devicePlanning/components/DeleteWorkAreaModal/index.tsx
const DeleteWorkAreaModal = ({ open, loading, submitting, record, counts, translation, getText, onClose, onConfirm }) => {
	const hasDevices = counts.smart + counts.dumb + counts.integrated > 0;
	const workAreaName = translation(record === null || record === void 0 ? void 0 : record.name) || "";
	return /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellModal, {
		open,
		title: getText("pisell2.saas.device-planning.delete.title"),
		headerDivider: false,
		onCancel: onClose,
		okVisible: !hasDevices,
		okText: getText("pisell2.saas.device-planning.delete.confirm-button"),
		cancelText: getText(hasDevices ? "pisell2.saas.device-planning.delete.close" : "pisell2.saas.device-planning.delete.cancel"),
		okButtonProps: {
			danger: true,
			loading: submitting,
			onClick: onConfirm
		},
		cancelButtonProps: { disabled: submitting },
		destroyOnClose: true,
		maskClosable: false,
		width: 520,
		className: "saas-device-planning-delete-modal",
		bodyStyle: { padding: "0 24px 24px" },
		footer: loading ? null : void 0
	}, loading ? /* @__PURE__ */ react.default.createElement("div", { className: "saas-device-planning-delete-modal__loading" }, /* @__PURE__ */ react.default.createElement(antd.Spin, null)) : hasDevices ? /* @__PURE__ */ react.default.createElement("div", { className: "saas-device-planning-delete-modal__body" }, /* @__PURE__ */ react.default.createElement(antd.Alert, {
		type: "warning",
		showIcon: true,
		icon: /* @__PURE__ */ react.default.createElement(_ant_design_icons.ExclamationCircleFilled, null),
		message: getText("pisell2.saas.device-planning.delete.block-title"),
		description: require_constants.formatToken(getText("pisell2.saas.device-planning.delete.block-content"), { WorkAreaName: workAreaName })
	}), /* @__PURE__ */ react.default.createElement("div", { className: "saas-device-planning-delete-modal__label" }, getText("pisell2.saas.device-planning.delete.devices-label")), /* @__PURE__ */ react.default.createElement("div", { className: "saas-device-planning-delete-modal__counts" }, counts.smart > 0 ? /* @__PURE__ */ react.default.createElement(_pisell_materials.Tag, null, require_constants.formatToken(getText("pisell2.saas.device-planning.delete.smart-count"), { N: counts.smart })) : null, counts.dumb > 0 ? /* @__PURE__ */ react.default.createElement(_pisell_materials.Tag, null, require_constants.formatToken(getText("pisell2.saas.device-planning.delete.dumb-count"), { N: counts.dumb })) : null, counts.integrated > 0 ? /* @__PURE__ */ react.default.createElement(_pisell_materials.Tag, null, require_constants.formatToken(getText("pisell2.saas.device-planning.delete.integrated-count"), { N: counts.integrated })) : null)) : /* @__PURE__ */ react.default.createElement("div", { className: "saas-device-planning-delete-modal__confirm" }, require_constants.formatToken(getText("pisell2.saas.device-planning.delete.confirm"), { WorkAreaName: workAreaName })));
};
//#endregion
exports.default = DeleteWorkAreaModal;
