import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.5ced94d7.js";import{b as h}from"./index.13e3df9c.js";import"./router.c33f3e79.js";import{C as i}from"./connector.8371083c.js";import{a as k}from"./asyncComputed.6f213f9d.js";import{e as x,q as E}from"./icons.157295a5.js";import{C as D}from"./CrudView.1c9778e2.js";import"./Title.74cb802d.js";import"./index.48bbb941.js";import"./activeRecord.6ae8bce9.js";import"./pubsub.f395e26b.js";import"./gateway.06420003.js";import"./index.8ea91ac5.js";import"./Form.3717142f.js";import"./url.b91ad4a3.js";import"./index.54325f84.js";import"./index.d48bc6c3.js";import"./index.c946e10c.js";import"./index.fe1573f2.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]="cc0dfddc-fc05-4dc1-9e2b-1c20c382dd99",o._sentryDebugIdIdentifier="sentry-dbid-cc0dfddc-fc05-4dc1-9e2b-1c20c382dd99")}catch{}})();const P=y({__name:"Connectors",setup(o){const r=b(),c=C(),a=r.params.projectId;async function s(e){const t=await i.create(a,e.name,e.type);c.push({name:"connectorEditor",params:{connectorId:t.id}})}const d=[{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:p,result:m,refetch:l}=k(()=>i.list(a)),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:f}){c.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(p),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:d,"create-button-text":"Create connector",onCreate:s},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Connectors.5396dea2.js.map
