import{d as y,ez as b,ey as C,G as _,b as g,c as I,u as k}from"./outputWidgets.0fb707c7.js";import{b as w}from"./columns.37a1e6f7.js";import"./router.81de177d.js";import{C as i}from"./connector.0ac483f3.js";import{a as h}from"./asyncComputed.a0ca296c.js";import{e as x,k as E}from"./icons.24a85994.js";import{C as D}from"./CrudView.e365e55f.js";import"./gateway.7ee47e62.js";import"./activeRecord.204186f3.js";import"./pubsub.7d8bce56.js";import"./index.cf4c23b9.js";import"./Form.0dcb97c0.js";import"./Title.f00a58f9.js";import"./transButton.220177fb.js";import"./Text.3ec0a64d.js";import"./index.140c5bc8.js";import"./url.d43b75f5.js";import"./index.85d2f01b.js";import"./index.8dbf2994.js";import"./index.0d3d2205.js";import"./index.e8ef1073.js";import"./index.a2e845fd.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]="e4bcfe1a-1956-4634-b37c-d190daf7dfd2",o._sentryDebugIdIdentifier="sentry-dbid-e4bcfe1a-1956-4634-b37c-d190daf7dfd2")}catch{}})();const U=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(w.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:d,refetch:l}=h(()=>i.list(c)),u=_(()=>{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)=>(g(),I(D,{"entity-name":"connector",loading:k(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{U as default};
//# sourceMappingURL=Connectors.23861e26.js.map
