import{d as y,eB as f,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.c4f3de67.js";import{b as h}from"./columns.aa61756c.js";import"./router.88734ca5.js";import{C as i}from"./connector.9c4f90d2.js";import{a as k}from"./asyncComputed.c75b06d6.js";import{e as x,g as E}from"./icons.49e74e71.js";import{C as D}from"./CrudView.4072ea68.js";import"./record.685c8ba7.js";import"./pubsub.1842fa2d.js";import"./gateway.5578a098.js";import"./Base.9ed9c296.js";import"./transButton.ebe60b80.js";import"./Text.fcf8f28f.js";import"./Title.345a4775.js";import"./index.db3809d7.js";import"./url.d2782274.js";import"./index.c4339fad.js";import"./index.b168b141.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[r]="527500b1-a22d-44bf-973b-9371972976cb",o._sentryDebugIdIdentifier="sentry-dbid-527500b1-a22d-44bf-973b-9371972976cb")}catch{}})();const L=y({__name:"Connectors",setup(o){const r=f(),a=C(),c=r.params.projectId;async function s(e){const t=await i.create(c,e.name,e.type);a.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:b}){a.push({name:"connectorEditor",params:{connectorId:b}})}},{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.2469c2fb.js.map
