import{d as y,ey as b,ex as C,F as _,b as g,u as w,bu as I}from"./registerWidgets.ff0e603c.js";import{b as h}from"./index.3750a98d.js";import"./gateway.69285524.js";import{C as s}from"./connector.d115c33a.js";import{a as k}from"./asyncComputed.47db4727.js";import{f as x,q as D}from"./icons.e90de051.js";import{C as E}from"./CrudView.edc9a540.js";import"./passwordlessManager.c02d6ee2.js";import"./pubsub.bd8735a3.js";import"./storage.db287aee.js";import"./activeRecord.193d97cb.js";import"./DropdownMenu.4c2a4e7f.js";import"./Modal.61a541af.js";import"./LoadingIndicator.40ce0e4a.js";import"./lottie.0af290d8.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]="f31ab317-f602-4c6e-994e-e3fb1fc23e7e",o._sentryDebugIdIdentifier="sentry-dbid-f31ab317-f602-4c6e-994e-e3fb1fc23e7e")}catch{}})();const H=y({__name:"Connectors",setup(o){const n=b(),a=C(),c=n.params.projectId;async function i(e){const t=await s.create(c,e.name,e.type);a.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:d}=k(()=>s.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=m.value)==null?void 0:e.map(r=>({key:r.id,cells:[{text:r.name,classes:["centered"]},{text:r.type},{text:"Actions",classes:["centered"],actions:[{icon:x,label:"Edit",onClick({key:f}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:D,label:"Delete",dangerous:!0,async onClick(){await r.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),w(E,{"entity-name":"connector",loading:I(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:u.value,fields:l,"create-button-text":"Create connector",onCreate:i},null,8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Connectors.1987f90f.js.map
