var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/saasDevice/appDevicePlanning/components/DeleteDeviceModal/index.tsx
var DeleteDeviceModal_exports = {};
__export(DeleteDeviceModal_exports, {
  default: () => DeleteDeviceModal_default
});
module.exports = __toCommonJS(DeleteDeviceModal_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_materials = require("@pisell/materials");
var import_icons = require("@ant-design/icons");
var import_constants = require("../../constants");
var DeleteDeviceModal = ({
  open,
  variant = "desktop",
  record,
  submitting,
  getText,
  onCancel,
  onConfirm
}) => {
  const isPhoneVariant = variant === "phone";
  const online = (record == null ? void 0 : record.status) === "online";
  const name = (record == null ? void 0 : record.name) || "";
  return /* @__PURE__ */ import_react.default.createElement(
    import_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: 520,
      platform: isPhoneVariant ? "h5" : void 0,
      mobileModalHeight: isPhoneVariant ? "auto" : void 0,
      className: `saas-app-device-planning-delete-device-modal saas-app-device-planning-delete-device-modal--${variant}`,
      bodyStyle: { padding: "0 24px 24px" }
    },
    online ? /* @__PURE__ */ import_react.default.createElement(
      import_antd.Alert,
      {
        type: "warning",
        showIcon: true,
        icon: /* @__PURE__ */ import_react.default.createElement(import_icons.ExclamationCircleFilled, null),
        message: getText(
          "pisell2.saas.device-planning.delete-device.online-title"
        ),
        description: (0, import_constants.formatToken)(
          getText("pisell2.saas.device-planning.delete-device.online-desc"),
          { DeviceName: name }
        )
      }
    ) : /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_constants.formatToken)(
      getText("pisell2.saas.device-planning.delete-device.confirm"),
      { DeviceName: name }
    ))
  );
};
var DeleteDeviceModal_default = DeleteDeviceModal;
