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