import{d as f,eB as b,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.91878a00.js";import{b as h}from"./index.8262a422.js";import"./router.77bfbaae.js";import{C as i}from"./connector.6b15db09.js";import{a as k}from"./asyncComputed.6ced1d7b.js";import{e as x,g as E}from"./icons.842bb077.js";import{C as D}from"./CrudView.d6529c3b.js";import"./record.8ded570d.js";import"./pubsub.862a9619.js";import"./gateway.6c51aaca.js";import"./Base.80d71c98.js";import"./transButton.c9ea1045.js";import"./Text.24e27494.js";import"./Title.cb0c3b9b.js";import"./index.571df689.js";import"./url.dddb8fdb.js";import"./index.aed07cef.js";import"./index.43a9b125.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]="557496f7-5589-41d7-8d59-d545d737e65b",o._sentryDebugIdIdentifier="sentry-dbid-557496f7-5589-41d7-8d59-d545d737e65b")}catch{}})();const L=f({__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 d=[{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:p,result:m,refetch:l}=k(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=m.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}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),I(D,{"entity-name":"connector",loading:w(p),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:d,"create-button-text":"Create connector",onCreate:s},null,8,["loading","table"]))}});export{L as default};
//# sourceMappingURL=Connectors.767d1c43.js.map
