import{d as b,K as C,b as g,t as _,z as s,J as w,H as I}from"./registerWidgets.358232d6.js";import{b as h}from"./index.2e4d6ec7.js";import"./gateway.a5838eb2.js";import{C as i}from"./connector.e5b6bb93.js";import{a as k}from"./asyncComputed.c8d50303.js";import{g as x,r as D}from"./icons.c4e80053.js";import{C as E}from"./CrudView.42bcc5b6.js";import"./passwordlessManager.5093fac0.js";import"./pubsub.5d0401cb.js";import"./activeRecord.360f8d7f.js";import"./DropdownMenu.47ef3fba.js";import"./Modal.a3024ac1.js";import"./LoadingIndicator.7cda47d1.js";import"./lottie.fbc237c8.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="3aa0d46f-d303-45ce-98c4-9ba0d070fbfc",o._sentryDebugIdIdentifier="sentry-dbid-3aa0d46f-d303-45ce-98c4-9ba0d070fbfc")}catch{}})();const Y=b({__name:"Connectors",setup(o){const n=w(),r=I(),c=n.params.projectId;async function d(e){const t=await i.create(c,e.name,e.type);r.push({name:"connectorEditor",params:{connectorId:t.id}})}const l=[{key:"name",label:"Connector name",type:"text"},{key:"type",label:"Connector type",type:Object.entries(h.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:p,result:m,refetch:u}=k(()=>i.list(c)),f=C(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=m.value)==null?void 0:e.map(a=>({key:a.id,cells:[{text:a.name,classes:["centered"]},{text:a.type},{text:"Actions",classes:["centered"],actions:[{icon:x,label:"Edit",onClick({key:y}){r.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:D,label:"Delete",dangerous:!0,async onClick(){await a.delete(),u()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),_(E,{"entity-name":"connector",loading:s(p),title:"Connectors",description:"Each connector is a version of your app. You can create a new connector by deploying your app from the local editor.","empty-title":"No connectors here yet",table:s(f),fields:l,"create-button-text":"Create connector",onCreate:d},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Connectors.6bbadc6d.js.map
