import{d as y,eB as b,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.31ce2d5c.js";import{b as h}from"./index.e05c62e3.js";import"./router.8f071dc2.js";import{C as i}from"./connector.a7dd929c.js";import{a as k}from"./asyncComputed.7e3e21f4.js";import{v as x,g as E}from"./icons.266b547d.js";import{C as v}from"./CrudView.9d67f588.js";import"./index.cf4c23b9.js";import"./record.b2148451.js";import"./pubsub.2d9ab3f4.js";import"./gateway.3615e807.js";import"./FormItem.5f0b61bf.js";import"./hasIn.932773c2.js";import"./index.0d76378d.js";import"./Text.46c5bec2.js";import"./Base.eeda2dae.js";import"./Form.482980d3.js";import"./Modal.32a7843c.js";import"./url.94a5ee71.js";import"./index.627ab86d.js";import"./index.ef6e34b6.js";import"./Title.951eccc5.js";import"./index.5765ee72.js";import"./index.f1d2e592.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]="b623d4f9-c2a1-4639-b77f-a8c3a92092bd",o._sentryDebugIdIdentifier="sentry-dbid-b623d4f9-c2a1-4639-b77f-a8c3a92092bd")}catch{}})();const X=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:d,refetch:l}=k(()=>i.list(c)),u=g(()=>{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}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),I(v,{"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{X as default};
//# sourceMappingURL=Connectors.eb0e8764.js.map
