import{d as y,J as b,H as C,K as _,b as g,t as w,z as I}from"./registerWidgets.cecc7add.js";import{b as h}from"./index.d9da78e8.js";import"./gateway.c00982e9.js";import{C as s}from"./connector.5c823b85.js";import{a as k}from"./asyncComputed.08fdcc30.js";import{f as x,q as D}from"./icons.a47594f6.js";import{C as E}from"./CrudView.48449181.js";import"./passwordlessManager.8b0c672e.js";import"./pubsub.a43e35aa.js";import"./activeRecord.2a9ab687.js";import"./DropdownMenu.4df8c96d.js";import"./Modal.4485a18b.js";import"./LoadingIndicator.06d4594a.js";import"./lottie.79ce2fdf.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]="4e802967-6c74-4f89-b50d-02a31bf399f3",o._sentryDebugIdIdentifier="sentry-dbid-4e802967-6c74-4f89-b50d-02a31bf399f3")}catch{}})();const V=y({__name:"Connectors",setup(o){const n=b(),r=C(),c=n.params.projectId;async function i(e){const t=await s.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:d,refetch:m}=k(()=>s.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=d.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:f}){r.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:D,label:"Delete",dangerous:!0,async onClick(){await a.delete(),m()}}]}]})))!=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{V as default};
//# sourceMappingURL=Connectors.35dc2b6a.js.map
