import{d as f,eB as y,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.5836624b.js";import{b as h}from"./columns.4caf6e41.js";import"./router.6746eb60.js";import{C as i}from"./connector.93368e28.js";import{a as k}from"./asyncComputed.134d378f.js";import{e as x,g as E}from"./icons.715dfb53.js";import{C as D}from"./CrudView.31db109e.js";import"./record.07dfd257.js";import"./pubsub.a82123ee.js";import"./gateway.681b899a.js";import"./Base.e549b429.js";import"./transButton.c5f8a15c.js";import"./Text.f4671d75.js";import"./Title.5e396b16.js";import"./index.ba80cfa7.js";import"./url.3b0a0ce2.js";import"./index.636b5d6d.js";import"./index.8d4f5f15.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]="39b022bb-5e32-4f17-9caf-bbe50b53972c",o._sentryDebugIdIdentifier="sentry-dbid-39b022bb-5e32-4f17-9caf-bbe50b53972c")}catch{}})();const L=f({__name:"Connectors",setup(o){const r=y(),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.967ce49b.js.map
