import{d as f,K as C,b as g,t as _,z as s,J as w,H as I}from"./registerWidgets.5e258592.js";import{b as h}from"./index.7276737e.js";import"./gateway.772dec88.js";import{C as i}from"./connector.4bf5db00.js";import{a as k}from"./asyncComputed.2269e9b0.js";import{g as x,t as D}from"./icons.854ecd29.js";import{C as E}from"./CrudView.90459d3b.js";import"./passwordlessManager.0607f999.js";import"./activeRecord.b3eba751.js";import"./DropdownMenu.bb27be32.js";import"./Modal.8489c194.js";import"./LoadingIndicator.fecca023.js";import"./lottie.8d9ff8b2.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]="d547ecf6-b6a9-4d64-be01-a5bb91602eda",o._sentryDebugIdIdentifier="sentry-dbid-d547ecf6-b6a9-4d64-be01-a5bb91602eda")}catch{}})();const V=f({__name:"Connectors",setup(o){const n=w(),r=I(),c=n.params.projectId;async function d(e){const t=await i.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:m,refetch:u}=k(()=>i.list(c)),b=C(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=m.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:y}){r.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:D,label:"Delete",dangerous:!0,async onClick(){await a.delete(),u()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),_(E,{"entity-name":"connector",loading:s(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:s(b),fields:l,"create-button-text":"Create connector",onCreate:d},null,8,["loading","table"]))}});export{V as default};
//# sourceMappingURL=Connectors.7c3825a4.js.map
