import { j as t } from "../../node_modules/react/jsx-runtime.mjs";
import { useState as d } from "react";
import "./index.less.mjs";
import m from "../../node_modules/antd/es/modal/index.mjs";
import p from "../../node_modules/@ant-design/icons/es/icons/CloseOutlined.mjs";
const j = ({ modalOpen: c = !1, modalEmit: o = () => {
}, modalText: l, deleteId: n, deleteUrl: r }) => {
  const [i, s] = d(!1), a = (e) => {
    switch (e) {
      case "ok":
        f();
        break;
      case "cancel":
        o("cancel");
        break;
    }
  }, f = async () => {
    try {
      s(!0);
      const e = await r(n);
      s(!1), console.log("res", e), o("success");
    } catch (e) {
      s(!1), o("fail"), console.log("e", e);
    }
  };
  return /* @__PURE__ */ t.jsx(
    m,
    {
      className: "bitzModalBlock",
      title: "提示",
      width: 400,
      open: c,
      closeIcon: /* @__PURE__ */ t.jsx(p, {}),
      onOk: () => {
        a("ok");
      },
      confirmLoading: i,
      onCancel: () => {
        a("cancel");
      },
      children: /* @__PURE__ */ t.jsx("div", { className: "textBox", children: l || "您确定要删除吗？" })
    }
  );
};
export {
  j as default
};
