import{d as y,ey as f,ex as C,F as _,b as g,u as w,bu as I}from"./registerWidgets.b2d74d6b.js";import{b as h}from"./index.0621dc6f.js";import"./gateway.eade7a58.js";import{C as s}from"./connector.d868e3f8.js";import{a as k}from"./asyncComputed.000dd401.js";import{f as x,q as D}from"./icons.9c4c14c4.js";import{C as E}from"./CrudView.9c7a617f.js";import"./passwordlessManager.1e9ad5f4.js";import"./pubsub.de7b160f.js";import"./storage.4c5a0e4a.js";import"./activeRecord.ad458e5f.js";import"./DropdownMenu.76f3715b.js";import"./Modal.6edff823.js";import"./LoadingIndicator.77ebb26b.js";import"./lottie.c84c89e3.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]="4c4de0b9-2b66-4dca-bda3-c8ad343aba30",o._sentryDebugIdIdentifier="sentry-dbid-4c4de0b9-2b66-4dca-bda3-c8ad343aba30")}catch{}})();const H=y({__name:"Connectors",setup(o){const n=f(),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 d=[{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:l,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(a=>({key:a.id,cells:[{text:a.name,classes:["centered"]},{text:a.type},{text:"Actions",classes:["centered"],actions:[{icon:x,label:"Edit",onClick({key:b}){r.push({name:"connectorEditor",params:{connectorId:b}})}},{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(l),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:d,"create-button-text":"Create connector",onCreate:i},null,8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Connectors.1d79d7cc.js.map
