const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.js");
const require_constants = require("../../../../model/constants.js");
const require_OnlineWarningAlert = require("../../../../components/shared/OnlineWarningAlert.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_materials = require("@pisell/materials");
//#region src/plus/saasDevice/devicePlanning/modules/devices/components/DeleteDeviceModal/index.tsx
const DeleteDeviceModal = ({ open, record, submitting, getText, onCancel, onConfirm }) => {
	const online = (record === null || record === void 0 ? void 0 : record.status) === "online";
	const name = (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-device.title"),
		headerDivider: false,
		onCancel,
		okText: getText(online ? "pisell2.saas.device-planning.delete-device.delete-anyway" : "pisell2.saas.device-planning.detail.delete"),
		cancelText: getText("pisell2.saas.device-planning.detail.cancel"),
		okButtonProps: {
			block: true,
			size: "large",
			danger: true,
			loading: submitting,
			onClick: onConfirm
		},
		cancelButtonProps: {
			block: true,
			size: "large",
			type: "default",
			disabled: submitting
		},
		destroyOnClose: true,
		maskClosable: false,
		width: 460,
		bodyStyle: { padding: "0 24px 24px" }
	}, online ? /* @__PURE__ */ react.default.createElement(require_OnlineWarningAlert.default, {
		message: getText("pisell2.saas.device-planning.delete-device.online-title"),
		description: require_constants.formatToken(getText("pisell2.saas.device-planning.delete-device.online-desc"), { DeviceName: name })
	}) : /* @__PURE__ */ react.default.createElement("div", null, require_constants.formatToken(getText("pisell2.saas.device-planning.delete-device.confirm"), { DeviceName: name })));
};
//#endregion
exports.default = DeleteDeviceModal;
