import{d as y,ez as b,ey as C,H as _,b as g,c as I,u as w}from"./outputWidgets.8be138ba.js";import{b as h}from"./columns.5510282a.js";import"./router.bb47648a.js";import{C as i}from"./connector.4a4915fd.js";import{a as k}from"./asyncComputed.96c9ad3b.js";import{e as x,q as E}from"./icons.35976e57.js";import{C as D}from"./CrudView.cfa43f1a.js";import"./gateway.93fa1934.js";import"./activeRecord.f6cce158.js";import"./pubsub.e324f67c.js";import"./index.f4ac7424.js";import"./Title.12e8916a.js";import"./index.0df733bd.js";import"./index.98827a3d.js";import"./Form.7b75db7b.js";import"./url.ebe1e528.js";import"./index.3ef3e2d2.js";import"./index.bc7e7ec9.js";import"./index.d11a75f6.js";import"./index.568a8efe.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]="fdcba79b-f02a-454e-91a7-7eb791df7543",o._sentryDebugIdIdentifier="sentry-dbid-fdcba79b-f02a-454e-91a7-7eb791df7543")}catch{}})();const Q=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(h.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:d,refetch:l}=k(()=>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: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{Q as default};
//# sourceMappingURL=Connectors.fed3e3d8.js.map
