import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.9b7c29ed.js";import{b as h}from"./index.3302f04a.js";import"./router.a8553211.js";import{C as i}from"./connector.f4ec371f.js";import{a as k}from"./asyncComputed.6a414bed.js";import{e as x,q as E}from"./icons.7c250a15.js";import{C as D}from"./CrudView.73bf57c7.js";import"./Title.55bc3e25.js";import"./index.31be9da9.js";import"./activeRecord.264ba54c.js";import"./pubsub.f1df5000.js";import"./gateway.3821173b.js";import"./index.ddedd1b8.js";import"./Form.77e50956.js";import"./url.c61c9940.js";import"./index.5695780b.js";import"./index.d8ed1958.js";import"./index.817f3ac7.js";import"./index.316bc1ac.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]="c64f6477-d254-42e1-b062-6f9f33501735",o._sentryDebugIdIdentifier="sentry-dbid-c64f6477-d254-42e1-b062-6f9f33501735")}catch{}})();const P=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(h.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:l,refetch:d}=k(()=>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: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.dc06d66d.js.map
