import{d as f,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.800838e3.js";import{b as h}from"./index.46095ec8.js";import"./router.ba9fc25a.js";import{C as i}from"./connector.f41ea3c1.js";import{a as k}from"./asyncComputed.982dc1f5.js";import{e as x,q as E}from"./icons.93f59c4e.js";import{C as D}from"./CrudView.b259bd34.js";import"./Title.28613ffd.js";import"./index.cc2e9ddf.js";import"./activeRecord.9d8d542d.js";import"./pubsub.3b460539.js";import"./gateway.872328f1.js";import"./index.e0615505.js";import"./Form.b8148ab8.js";import"./url.e7bb6b8a.js";import"./index.9edddcd4.js";import"./index.70fbd67e.js";import"./index.c4440e89.js";import"./index.960544fb.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]="87c0fb90-b915-4c4d-aa0a-3ae037d2289e",o._sentryDebugIdIdentifier="sentry-dbid-87c0fb90-b915-4c4d-aa0a-3ae037d2289e")}catch{}})();const P=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=_(()=>{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)=>(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{P as default};
//# sourceMappingURL=Connectors.211f3cf3.js.map
