var T=Object.defineProperty;var b=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var h=(n,e,s)=>e in n?T(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,u=(n,e)=>{for(var s in e||(e={}))k.call(e,s)&&h(n,s,e[s]);if(b)for(var s of b(e))y.call(e,s)&&h(n,s,e[s]);return n};import{j as t,_ as i,b as z}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as C}from"./Note.DalStCGz.js";import{T as A}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function M({formID:n,ninjaTablesConf:e,setNinjaTablesConf:s,step:l,nextPage:p,isLoading:g,setIsLoading:o,setSnackbar:c,isInfo:j}){var d;const[r,f]=x.useState(!1),[N,v]=x.useState(!1),w=()=>{o("auth"),z({formID:n},"ninja_tables_authorize").then(a=>{a!=null&&a.success?(f(!0),c({show:!0,msg:i("Connected with Ninja Tables successfully","bit-integrations")}),o(!1)):(v(!0),c({show:!0,msg:i(a!=null&&a.data?a.data:"Connection failed. Please make sure Ninja Tables is installed and activated","bit-integrations")}),o(!1))})};return t.jsxs(t.Fragment,{children:[t.jsx(A,{title:i("NinjaTables","bit-integrations"),docLink:(d=tutorialLinks.ninjaTables)==null?void 0:d.docLink}),t.jsxs("div",{className:"btcd-stp-page",style:{width:l===1&&900,height:l===1&&"auto"},children:[t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m=>{const a=u({},e);a.name=m.target.value,s(a)},name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),t.jsxs("button",{onClick:w,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r,children:[r?i("Connected ✔","bit-integrations"):i("Connect to Ninja Tables","bit-integrations"),g==="auth"&&t.jsx(C,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),N&&t.jsx("div",{className:"flx",style:{width:"450px",marginTop:"10px"},children:t.jsxs("span",{className:"txt-orange",style:{fontSize:"14px"},children:[t.jsx("strong",{children:i("Reminder:","bit-integrations")})," ",i("Please make sure Ninja Tables plugin is installed and activated.","bit-integrations")]})}),!j&&t.jsxs("div",{children:[t.jsx("br",{}),t.jsxs("button",{onClick:()=>p(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})]})}export{M as default};
