import{d as y,eB as b,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.df68f70a.js";import{b as h}from"./index.5b8834fd.js";import"./router.d34810ba.js";import{C as i}from"./connector.ee67c39b.js";import{a as k}from"./asyncComputed.c4f3fa7a.js";import{e as x,g as E}from"./icons.6f0b428b.js";import{C as D}from"./CrudView.8169c4b4.js";import"./record.493f7d84.js";import"./pubsub.26abae80.js";import"./gateway.104fd643.js";import"./Base.8da1f136.js";import"./transButton.b32cb3fc.js";import"./Text.5293eafa.js";import"./Title.d7a9606c.js";import"./index.a1698b08.js";import"./url.e14018a7.js";import"./index.4c2136c4.js";import"./index.f12da0b9.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="2ef420a0-067c-4c30-9604-af1a2b18bc75",o._sentryDebugIdIdentifier="sentry-dbid-2ef420a0-067c-4c30-9604-af1a2b18bc75")}catch{}})();const L=y({__name:"Connectors",setup(o){const a=b(),r=C(),c=a.params.projectId;async function s(e){const t=await i.create(c,e.name,e.type);r.push({name:"connectorEditor",params:{connectorId:t.id}})}const p=[{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:m,result:l,refetch:d}=k(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=l.value)==null?void 0:e.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"connectorEditor",params:{connectorId:n.id}}},{text:n.type},{text:"Actions",actions:[{icon:x,label:"Edit",onClick({key:f}){r.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),I(D,{"entity-name":"connector",loading:w(m),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:p,"create-button-text":"Create connector",onCreate:s},null,8,["loading","table"]))}});export{L as default};
//# sourceMappingURL=Connectors.65d8aa70.js.map
