"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),l=require("@elastic/eui");require("react-router-dom");require("../components/Icons/EuiIcon.js");const M=require("../components/Button.js"),F=require("./Form.js"),p=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=p(c),b=({schema:t,values:d,onSubmit:s,title:i,buttons:m,button:o})=>{const[f,a]=c.useState(!1),E=l.useGeneratedHtmlId({prefix:"modalForm"}),r=()=>a(!1),n=()=>a(!0);let u;return f&&(u=e.default.createElement(l.EuiModal,{onClose:r,initialFocus:"[name=popswitch]"},e.default.createElement(l.EuiModalHeader,null,e.default.createElement(l.EuiModalHeaderTitle,null,e.default.createElement("h2",{className:"text-lg"},i))),e.default.createElement(l.EuiModalBody,null,e.default.createElement(F.Form,{formId:E,data:t,values:d,onSubmit:s,buttons:m,onCloseModal:r})))),e.default.createElement("div",null,o?e.default.createElement(M.Button,{label:o.label,icon:o.icon,onClick:n,className:"border boder-gray-600"}):e.default.createElement(l.EuiLink,{onClick:n},"\u7F16\u8F91"),u)};exports.FormModal=b;
//# sourceMappingURL=Modal.js.map
