var z=Object.defineProperty;var x=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var g=(e,a,s)=>a in e?z(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,m=(e,a)=>{for(var s in a||(a={}))S.call(a,s)&&g(e,s,a[s]);if(x)for(var s of x(a))T.call(a,s)&&g(e,s,a[s]);return e};import{j as t,_ as i}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z as K}from"./Note.BeM7sN-p.js";import{s as L}from"./SendGridCommonFunc.C-4o5Kgg.js";import{t as w}from"./tutorialLinks.kMkIDzcD.js";import{T as y}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function Y({sendGridConf:e,setSendGridConf:a,step:s,setStep:k,loading:n,setLoading:N,isInfo:o}){const[l,v]=j.useState(!1),[p,b]=j.useState({name:"",secretKey:""}),{sendGrid:r}=w,A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,k(2)},u=c=>{const d=m({},e),h=m({},p);h[c.target.name]="",d[c.target.name]=c.target.value,b(h),a(d)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(y,{title:"SendGrid",youTubeLink:r==null?void 0:r.youTubeLink}),t.jsx(y,{title:"SendGrid",docLink:r==null?void 0:r.docLink}),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:u,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:o}),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:u,name:"apiKey",value:e.apiKey,type:"text",placeholder:i("Your Api Key","bit-integrations"),disabled:o}),t.jsx("div",{className:"mt-3",style:{color:"red",fontSize:"15px"},children:p.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",{}),!o&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>L(e,a,b,v,n,N,"authentication"),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||n.auth,children:[l?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),n.auth&&t.jsx(K,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:A,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{Y as default};
