import{d as f,eB as b,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.e60ab380.js";import{b as h}from"./columns.4c9d4799.js";import"./router.0cf2e70d.js";import{C as i}from"./connector.9e7325fd.js";import{a as k}from"./asyncComputed.7ba647bd.js";import{e as x,g as E}from"./icons.6c1915db.js";import{C as D}from"./CrudView.a4f4d47c.js";import"./record.04c6d5a0.js";import"./pubsub.e6733ea4.js";import"./gateway.990f0877.js";import"./Base.0638c3f7.js";import"./transButton.1b3f66c8.js";import"./Text.742cb8ec.js";import"./Title.666a14b1.js";import"./index.1462457d.js";import"./url.7bd60adc.js";import"./index.ed25df4f.js";import"./index.aaa1fe24.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="8c1605ad-e458-4414-a9c1-ced778a1a521",o._sentryDebugIdIdentifier="sentry-dbid-8c1605ad-e458-4414-a9c1-ced778a1a521")}catch{}})();const L=f({__name:"Connectors",setup(o){const a=b(),r=C(),c=a.params.projectId;async function s(e){const t=await i.create(c,e.name,e.type);r.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:y}){r.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(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.d3beec39.js.map
