var v=Object.defineProperty;var h=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var x=(e,a,s)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,c=(e,a)=>{for(var s in a||(a={}))A.call(a,s)&&x(e,s,a[s]);if(h)for(var s of h(a))K.call(a,s)&&x(e,s,a[s]);return e};import{j as t,_ as i}from"./main.2.8.10.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as z}from"./Note.DalStCGz.js";import{s as w}from"./SendGridCommonFunc.BAzcKyKN.js";import{T as I}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function R({sendGridConf:e,setSendGridConf:a,step:s,setStep:j,loading:r,setLoading:y,isInfo:n}){const[l,N]=g.useState(!1),[m,p]=g.useState({name:"",secretKey:""}),k=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},b=o=>{const d=c({},e),u=c({},m);u[o.target.name]="",d[o.target.name]=o.target.value,p(u),a(d)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(I,{linkKey:"sendGrid"}),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:b,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:n}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:b,name:"apiKey",value:e.apiKey,type:"text",placeholder:i("Your Api Key","bit-integrations"),disabled:n}),t.jsx("div",{className:"mt-3",style:{color:"red",fontSize:"15px"},children:m.apiKey}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To Get API key & Secret Key, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.sendgrid.com/settings/api_keys",target:"_blank",rel:"noreferrer",children:i("SendGrid API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!n&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>w(e,a,p,N,r,y,"authentication"),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r.auth,children:[l?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),r.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:k,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{R as default};
