import e, { useState as s } from "react";
import "react-router-dom";
import "./Icons/EuiIcon.js";
import { Button as c } from "./Button.js";
import { useGeneratedHtmlId as d, EuiLink as u, EuiModal as E, EuiModalHeader as p, EuiModalHeaderTitle as M, EuiModalBody as f } from "@elastic/eui";
const v = ({ schema: b, values: h, onSubmit: F, title: i, button: l, children: r }) => {
  const [n, t] = s(!1);
  d({ prefix: "modalForm" });
  const m = () => t(!1), a = () => t(!0);
  let o;
  return n && (o = /* @__PURE__ */ e.createElement(E, {
    onClose: m,
    initialFocus: "[name=popswitch]"
  }, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(M, null, /* @__PURE__ */ e.createElement("h2", {
    className: "text-lg"
  }, i))), /* @__PURE__ */ e.createElement(f, null, r))), /* @__PURE__ */ e.createElement("div", null, l ? /* @__PURE__ */ e.createElement(c, {
    label: l.label,
    icon: l.icon,
    onClick: a,
    className: "border boder-gray-600"
  }) : /* @__PURE__ */ e.createElement(u, {
    onClick: a
  }, "\u7F16\u8F91"), o);
};
export {
  v as Modal
};
//# sourceMappingURL=Modal.js.map
