import{d as f,eB as b,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.a5fcf389.js";import{b as h}from"./index.b67da7e9.js";import"./router.8a74f04b.js";import{C as i}from"./connector.b4bc160a.js";import{a as k}from"./asyncComputed.b7d3265e.js";import{e as x,g as E}from"./icons.1a1dc210.js";import{C as D}from"./CrudView.cee1047f.js";import"./record.e2e84f62.js";import"./pubsub.903f7e54.js";import"./gateway.5878b159.js";import"./Base.175f3ec4.js";import"./transButton.fc314012.js";import"./Text.d2260f67.js";import"./Title.42ad4bfb.js";import"./index.39083dd8.js";import"./url.d6641ded.js";import"./index.48f4731a.js";import"./index.5b7d1aca.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]="62e91a3a-4f8a-4ec9-a894-477b188667d9",o._sentryDebugIdIdentifier="sentry-dbid-62e91a3a-4f8a-4ec9-a894-477b188667d9")}catch{}})();const L=f({__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:y}){r.push({name:"connectorEditor",params:{connectorId:y}})}},{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.4114263e.js.map
