import{d as y,eB as b,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.e822ff0f.js";import{b as h}from"./index.3b830ff3.js";import"./router.8fbd98d9.js";import{C as i}from"./connector.fd677fab.js";import{a as k}from"./asyncComputed.68870ff7.js";import{e as x,g as E}from"./icons.0ab0d55f.js";import{C as D}from"./CrudView.0a0ee0a6.js";import"./record.edca104e.js";import"./pubsub.ae710ef5.js";import"./gateway.349a9491.js";import"./Base.775de4d5.js";import"./transButton.f06af665.js";import"./Text.4c9d53a2.js";import"./Title.5afb3003.js";import"./index.bf8163eb.js";import"./url.c786ab78.js";import"./index.eb9667df.js";import"./index.1b95bbbc.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]="0e5c0d71-aff6-4b7c-adcb-3ec98ef5b20c",o._sentryDebugIdIdentifier="sentry-dbid-0e5c0d71-aff6-4b7c-adcb-3ec98ef5b20c")}catch{}})();const L=y({__name:"Connectors",setup(o){const r=b(),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:d,refetch:l}=k(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=d.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}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=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.5e11b328.js.map
