import{d as b,ez as f,ey as C,H as _,b as g,c as I,u as w}from"./outputWidgets.942e04a7.js";import{b as h}from"./columns.b249ad7a.js";import"./router.88ac172f.js";import{C as i}from"./connector.b41e95be.js";import{a as k}from"./asyncComputed.581a6d32.js";import{e as x,q as E}from"./icons.c37bd5be.js";import{C as D}from"./CrudView.ef33eac6.js";import"./gateway.c853ac2b.js";import"./activeRecord.c49c8827.js";import"./pubsub.c4874b0f.js";import"./index.f4ac7424.js";import"./Title.02f374d5.js";import"./index.6d3b437a.js";import"./index.a0056785.js";import"./Form.fa989528.js";import"./url.c27b4b3f.js";import"./index.afbbab9c.js";import"./index.a1c695e0.js";import"./index.f7b7cb5d.js";import"./index.182b7916.js";import"./index.90e879e1.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]="88ddbd99-f5b2-4d4b-8e52-cae43949413a",o._sentryDebugIdIdentifier="sentry-dbid-88ddbd99-f5b2-4d4b-8e52-cae43949413a")}catch{}})();const S=b({__name:"Connectors",setup(o){const r=f(),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:d,result:m,refetch:l}=k(()=>i.list(c)),u=_(()=>{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)=>(g(),I(D,{"entity-name":"connector",loading:w(d),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{S as default};
//# sourceMappingURL=Connectors.a76d0150.js.map
