import{d as f,ez as b,ey as C,H as _,b as g,c as I,u as w}from"./outputWidgets.397b3720.js";import{b as h}from"./columns.37df3c3d.js";import"./router.3bc1b205.js";import{C as i}from"./connector.df0706b4.js";import{a as k}from"./asyncComputed.28fc9d36.js";import{e as x,q as E}from"./icons.5e65f599.js";import{C as D}from"./CrudView.77c1d16d.js";import"./gateway.b868389d.js";import"./activeRecord.6bb6b853.js";import"./pubsub.fe0f0397.js";import"./index.f4ac7424.js";import"./Title.382247fb.js";import"./index.06276212.js";import"./index.19008df2.js";import"./Form.5ce50c8f.js";import"./url.53bc193a.js";import"./index.4acaedbb.js";import"./index.c9ea7155.js";import"./index.40ca2e79.js";import"./index.e12747aa.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]="907c9a59-49c1-46be-94e1-3dd232c8a5f8",o._sentryDebugIdIdentifier="sentry-dbid-907c9a59-49c1-46be-94e1-3dd232c8a5f8")}catch{}})();const Q=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: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: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(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.ff8a87fe.js.map
