import{d as y,K as b,J as C,L as _,b as g,u as w,A as I}from"./registerWidgets.f8dfb33f.js";import{b as h}from"./index.b0f5af92.js";import"./gateway.3cfecd5b.js";import{C as s}from"./connector.ef23a1c0.js";import{a as k}from"./asyncComputed.a78c0f7f.js";import{f as x,q as D}from"./icons.074088c2.js";import{C as E}from"./CrudView.25d523c5.js";import"./passwordlessManager.e17ec9bd.js";import"./pubsub.4b58e722.js";import"./activeRecord.b9bfe1cb.js";import"./DropdownMenu.d38a204c.js";import"./Modal.b37564e2.js";import"./LoadingIndicator.471e197d.js";import"./lottie.c7ecbe32.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]="eb76982b-ff6d-4435-91d0-b37ee0171329",o._sentryDebugIdIdentifier="sentry-dbid-eb76982b-ff6d-4435-91d0-b37ee0171329")}catch{}})();const Y=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:d,result:p,refetch:m}=k(()=>s.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=p.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(),m()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),w(E,{"entity-name":"connector",loading:I(d),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{Y as default};
//# sourceMappingURL=Connectors.c82aa63f.js.map
