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/hooks/useModal.integration.example.tsx
var useModal_integration_example_exports = {};
__export(useModal_integration_example_exports, {
  ConfirmDeleteModal: () => ConfirmDeleteModal,
  InfoModal: () => InfoModal,
  IntegrationExamples: () => IntegrationExamples,
  SendPaymentLinkModal: () => SendPaymentLinkModal
});
module.exports = __toCommonJS(useModal_integration_example_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_icon = require("@pisell/icon");
var import_useModal = __toESM(require("./useModal"));
var SendPaymentLinkModal = ({
  balanceAmount = "$15.1",
  customerEmail = "customer@email.com"
}) => {
  const [selectedEmailOption, setSelectedEmailOption] = (0, import_react.useState)("existing");
  const [newEmailAddress, setNewEmailAddress] = (0, import_react.useState)("");
  const { open, close, Modal } = (0, import_useModal.default)({
    defaultProps: {
      title: "Send Payment Link",
      width: 640,
      centered: true,
      footer: null
    }
  });
  const handleSendLink = () => {
    console.log("Send link clicked");
    if (selectedEmailOption === "existing") {
      console.log("Send to existing email:", customerEmail);
    } else {
      console.log("Send to new email:", newEmailAddress);
    }
    close();
  };
  const handleSaveEmailAddress = () => {
    console.log("Save email address clicked");
    close();
  };
  const openModal = () => {
    open();
  };
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: openModal }, "发送支付链接"), /* @__PURE__ */ import_react.default.createElement(Modal, null, /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "20px 0" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "32px" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { flex: "0 0 182px" } }, /* @__PURE__ */ import_react.default.createElement(
    "img",
    {
      src: "https://placehold.co/182x201",
      alt: "Send Payment Link Illustration",
      style: { width: "100%", height: "auto" }
    }
  )), /* @__PURE__ */ import_react.default.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: "24px" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: {
    fontSize: "16px",
    fontWeight: 500,
    marginBottom: "8px"
  } }, "Balance amount"), /* @__PURE__ */ import_react.default.createElement("div", { style: {
    fontSize: "32px",
    fontWeight: 600,
    color: "#1890ff"
  } }, balanceAmount)), /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: "32px" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: {
    fontSize: "16px",
    fontWeight: 500,
    marginBottom: "16px"
  } }, "Where would you like to send the payment link?"), /* @__PURE__ */ import_react.default.createElement(
    import_antd.Radio.Group,
    {
      value: selectedEmailOption,
      onChange: (e) => setSelectedEmailOption(e.target.value),
      style: { width: "100%" }
    },
    /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: "16px" } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: "existing" }, /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ import_react.default.createElement("span", null, "Send to existing email address"), /* @__PURE__ */ import_react.default.createElement(
      import_antd.Button,
      {
        type: "text",
        size: "small",
        icon: /* @__PURE__ */ import_react.default.createElement(import_icon.Edit05, null),
        style: { padding: 0, minWidth: "auto" }
      }
    ))), selectedEmailOption === "existing" && /* @__PURE__ */ import_react.default.createElement("div", { style: {
      marginLeft: "24px",
      marginTop: "8px",
      color: "#666"
    } }, customerEmail)),
    /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Radio, { value: "new" }, "Send to a new email address"), selectedEmailOption === "new" && /* @__PURE__ */ import_react.default.createElement(
      import_antd.Input,
      {
        placeholder: "Enter email address",
        value: newEmailAddress,
        onChange: (e) => setNewEmailAddress(e.target.value),
        style: { marginLeft: "24px", marginTop: "8px" }
      }
    ))
  )), /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, /* @__PURE__ */ import_react.default.createElement(
    import_antd.Button,
    {
      type: "primary",
      onClick: handleSendLink,
      style: { minWidth: "120px" }
    },
    "Send Link"
  ), selectedEmailOption === "new" && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleSaveEmailAddress }, "Save Email Address"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: close }, "Cancel")))))));
};
var ConfirmDeleteModal = () => {
  const { open, close, Modal } = (0, import_useModal.default)({
    defaultProps: {
      title: "确认删除",
      size: "small",
      okText: "删除",
      cancelText: "取消",
      okType: "danger"
    }
  });
  const handleDelete = () => {
    console.log("执行删除操作...");
    setTimeout(() => {
      console.log("删除成功！");
      close();
    }, 1e3);
  };
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { danger: true, onClick: () => open() }, "删除项目"), /* @__PURE__ */ import_react.default.createElement(Modal, { onOk: handleDelete }, /* @__PURE__ */ import_react.default.createElement("p", null, "确定要删除这个项目吗？此操作不可撤销。")));
};
var InfoModal = () => {
  const { open, Modal } = (0, import_useModal.default)({
    defaultProps: {
      title: "系统信息",
      footer: null,
      size: "middle"
    }
  });
  const handleOpenInfo = () => {
    open({
      title: `系统信息 - ${(/* @__PURE__ */ new Date()).toLocaleString()}`
    });
  };
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleOpenInfo }, "查看系统信息"), /* @__PURE__ */ import_react.default.createElement(Modal, null, /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "16px 0" } }, /* @__PURE__ */ import_react.default.createElement("h4", null, "系统状态"), /* @__PURE__ */ import_react.default.createElement("ul", null, /* @__PURE__ */ import_react.default.createElement("li", null, "版本：v2.1.0"), /* @__PURE__ */ import_react.default.createElement("li", null, "运行时间：15天3小时"), /* @__PURE__ */ import_react.default.createElement("li", null, "内存使用：65%"), /* @__PURE__ */ import_react.default.createElement("li", null, "存储空间：78%")), /* @__PURE__ */ import_react.default.createElement("h4", null, "最近更新"), /* @__PURE__ */ import_react.default.createElement("ul", null, /* @__PURE__ */ import_react.default.createElement("li", null, "2024-01-15: 修复支付模块bug"), /* @__PURE__ */ import_react.default.createElement("li", null, "2024-01-10: 新增批量导出功能"), /* @__PURE__ */ import_react.default.createElement("li", null, "2024-01-05: 优化页面加载速度")))));
};
var IntegrationExamples = () => {
  return /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: 24 } }, /* @__PURE__ */ import_react.default.createElement("h1", null, "useModal Hook 集成示例"), /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 24 } }, /* @__PURE__ */ import_react.default.createElement("h2", null, "重构后的发送支付链接模态框"), /* @__PURE__ */ import_react.default.createElement(SendPaymentLinkModal, null)), /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 24 } }, /* @__PURE__ */ import_react.default.createElement("h2", null, "确认删除对话框"), /* @__PURE__ */ import_react.default.createElement(ConfirmDeleteModal, null)), /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 24 } }, /* @__PURE__ */ import_react.default.createElement("h2", null, "信息展示对话框"), /* @__PURE__ */ import_react.default.createElement(InfoModal, null)));
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ConfirmDeleteModal,
  InfoModal,
  IntegrationExamples,
  SendPaymentLinkModal
});
