import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.903ef13f.js";import{b as h}from"./index.7a97ebf0.js";import"./router.ddb32f08.js";import{C as i}from"./connector.804f7629.js";import{a as k}from"./asyncComputed.c4e04ddf.js";import{e as x,q as E}from"./icons.c6b9d5b7.js";import{C as D}from"./CrudView.87fcb808.js";import"./Title.a0ce44ea.js";import"./index.e5fe38b8.js";import"./activeRecord.55ed0790.js";import"./pubsub.c9a1cd12.js";import"./gateway.a6a9ad01.js";import"./index.038e0c5b.js";import"./Form.49dc913d.js";import"./url.08ed6687.js";import"./index.c70ecf50.js";import"./index.d93d8aa2.js";import"./index.abf1ee4c.js";import"./index.ff825c04.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]="af6999dc-6acf-4f48-98a1-d9904a0fef29",o._sentryDebugIdIdentifier="sentry-dbid-af6999dc-6acf-4f48-98a1-d9904a0fef29")}catch{}})();const P=y({__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:f}){r.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(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.b3b466aa.js.map
