import{d as y,ez as b,ey as C,H as _,b as g,c as I,u as k}from"./outputWidgets.1739e6b5.js";import{b as w}from"./columns.0d2e1661.js";import"./router.95125983.js";import{C as i}from"./connector.9e4428c2.js";import{a as h}from"./asyncComputed.b4d87a94.js";import{e as x,k as E}from"./icons.1c3e2bde.js";import{C as D}from"./CrudView.245e4133.js";import"./gateway.8b5d469f.js";import"./activeRecord.55a23e4a.js";import"./pubsub.e4395938.js";import"./index.f4ac7424.js";import"./Title.1261c75a.js";import"./index.92715e30.js";import"./Text.f4c0ef3e.js";import"./Form.6a4829ad.js";import"./url.8bddfe76.js";import"./index.aaa812ca.js";import"./index.663f575e.js";import"./index.366cf7e1.js";import"./index.8b3d4030.js";import"./index.55ff2de5.js";import"./index.fbff59b3.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]="fc3b2d3e-72fb-41ea-a541-2fc0614e62cb",o._sentryDebugIdIdentifier="sentry-dbid-fc3b2d3e-72fb-41ea-a541-2fc0614e62cb")}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:l,refetch:d}=h(()=>i.list(c)),u=_(()=>{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:f}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=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.1a9be60a.js.map
