import { formatToken } from "../../constants.js";
import React from "react";
import { Alert } from "antd";
import { PisellModal } from "@pisell/materials";
import { ExclamationCircleFilled } from "@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.createElement(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.createElement(Alert, {
		type: "warning",
		showIcon: true,
		icon: /* @__PURE__ */ React.createElement(ExclamationCircleFilled, null),
		message: getText("pisell2.saas.device-planning.delete-device.online-title"),
		description: formatToken(getText("pisell2.saas.device-planning.delete-device.online-desc"), { DeviceName: name })
	}) : /* @__PURE__ */ React.createElement("div", null, formatToken(getText("pisell2.saas.device-planning.delete-device.confirm"), { DeviceName: name })));
};
//#endregion
export { DeleteDeviceModal as default };
