import{d as f,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.df0b7764.js";import{b as h}from"./index.be0d60a2.js";import"./router.7d542f8a.js";import{C as i}from"./connector.6d13c06c.js";import{a as k}from"./asyncComputed.46396f29.js";import{e as x,q as E}from"./icons.649962e7.js";import{C as D}from"./CrudView.c17fe492.js";import"./Title.d627f1f5.js";import"./index.8131d28d.js";import"./activeRecord.af31c98a.js";import"./pubsub.82647744.js";import"./gateway.315bccd7.js";import"./index.0830e379.js";import"./Form.29bcac3f.js";import"./url.b34e96a5.js";import"./index.eb14364d.js";import"./index.b2e095c7.js";import"./index.5c49f4fd.js";import"./index.317ac553.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]="1d55570f-ba4b-48d2-9847-43e762a0979c",o._sentryDebugIdIdentifier="sentry-dbid-1d55570f-ba4b-48d2-9847-43e762a0979c")}catch{}})();const P=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{P as default};
//# sourceMappingURL=Connectors.a7825f5e.js.map
