import{d as y,eB as b,eA as C,G as _,b as g,c as I,u as k}from"./outputWidgets.427e9347.js";import{b as w}from"./columns.eab062cb.js";import"./router.1a20c20c.js";import{C as i}from"./connector.4efb60f4.js";import{a as h}from"./asyncComputed.32abd7c2.js";import{e as x,k as E}from"./icons.2a865956.js";import{C as D}from"./CrudView.22a93e62.js";import"./gateway.5f288bf8.js";import"./activeRecord.91f10272.js";import"./pubsub.9b59356e.js";import"./index.cf4c23b9.js";import"./Base.dbea8db9.js";import"./FormItem.e1548cef.js";import"./transButton.470f2fe6.js";import"./Text.31458a16.js";import"./Title.213e158e.js";import"./index.e440fe17.js";import"./url.9044ee0d.js";import"./index.8fcd530b.js";import"./index.36e3a141.js";import"./index.3804082b.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]="c24b28f3-cc2f-4709-9549-cb465491e0ef",o._sentryDebugIdIdentifier="sentry-dbid-c24b28f3-cc2f-4709-9549-cb465491e0ef")}catch{}})();const S=y({__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(w.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:l,refetch:d}=h(()=>i.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=l.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}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),I(D,{"entity-name":"connector",loading:k(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{S as default};
//# sourceMappingURL=Connectors.64c86bcc.js.map
