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");
//#region src/plus/saasDevice/devicePlanning/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: {
			danger: true,
			loading: submitting,
			onClick: onConfirm
		},
		cancelButtonProps: { disabled: submitting },
		destroyOnClose: true,
		maskClosable: false,
		width: 460,
		bodyStyle: { padding: "0 24px 24px" }
	}, online ? /* @__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-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;
