import{d as f,eB as b,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.396f5ce1.js";import{b as h}from"./index.d80eeb49.js";import"./router.898a5ca4.js";import{C as i}from"./connector.0fecf29c.js";import{a as k}from"./asyncComputed.95737324.js";import{v as x,g as E}from"./icons.37b6f90f.js";import{C as v}from"./CrudView.ece8081d.js";import"./index.cf4c23b9.js";import"./record.1aff3d29.js";import"./pubsub.06faa612.js";import"./gateway.a0e7cb55.js";import"./FormItem.a8de7296.js";import"./hasIn.63a13365.js";import"./index.f3919413.js";import"./Text.4e180dc2.js";import"./Base.ee1dde08.js";import"./Form.716e7fa5.js";import"./Modal.c02a2840.js";import"./url.4e42e1d0.js";import"./index.645b3e28.js";import"./index.a44632c5.js";import"./Title.819eb0fe.js";import"./index.f0384574.js";import"./index.a23873b5.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]="a788419e-1134-4702-95fe-d717eb84b498",o._sentryDebugIdIdentifier="sentry-dbid-a788419e-1134-4702-95fe-d717eb84b498")}catch{}})();const X=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 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:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),I(v,{"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{X as default};
//# sourceMappingURL=Connectors.2d32864c.js.map
