import{d as y,J as b,H as C,K as g,b as _,t as w,z as I}from"./registerWidgets.7afd6438.js";import{b as h}from"./index.9e389ffd.js";import"./gateway.2390ee89.js";import{C as s}from"./connector.84dc948a.js";import{a as k}from"./asyncComputed.b60ddd9a.js";import{g as x,r as D}from"./icons.0ae396f2.js";import{C as E}from"./CrudView.ab882a67.js";import"./passwordlessManager.7da7ab9e.js";import"./pubsub.9805d82b.js";import"./activeRecord.e140ff8e.js";import"./DropdownMenu.90d44aab.js";import"./Modal.94284cfc.js";import"./LoadingIndicator.b2e0f173.js";import"./lottie.36f8e1f2.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]="28a9fca6-e688-4c7c-84a4-e03c8f23ab49",o._sentryDebugIdIdentifier="sentry-dbid-28a9fca6-e688-4c7c-84a4-e03c8f23ab49")}catch{}})();const Y=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=g(()=>{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)=>(_(),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{Y as default};
//# sourceMappingURL=Connectors.d797cc3b.js.map
