import{d as f,eB as y,eA as C,G as g,b as _,c as I,u as w}from"./outputWidgets.e33755f8.js";import{b as h}from"./index.0a6756f7.js";import"./authorManager.62b862f9.js";import{C as i}from"./connector.b3274379.js";import{a as k}from"./asyncComputed.8bd4aeca.js";import{v as x,g as E}from"./icons.f6b19bc0.js";import{C as v}from"./CrudView.2f0c3c83.js";import"./index.cf4c23b9.js";import"./record.fe2d13ca.js";import"./pubsub.d8fbcc91.js";import"./gateway.f3da19f9.js";import"./Text.03e848c4.js";import"./Title.ac2baa04.js";import"./FormItem.fdb358e6.js";import"./hasIn.5c4a4bf3.js";import"./Form.e78b9235.js";import"./Modal.e934f1f6.js";import"./router.8c7b3fad.js";import"./index.9f6d3055.js";import"./url.3d250afc.js";import"./index.98828044.js";import"./index.58a4a13c.js";import"./index.4b06b554.js";import"./index.72b0b8fe.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]="cf456e86-437e-4bab-a2fe-bbfe88edb5b3",o._sentryDebugIdIdentifier="sentry-dbid-cf456e86-437e-4bab-a2fe-bbfe88edb5b3")}catch{}})();const X=f({__name:"Connectors",setup(o){const r=y(),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=g(()=>{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:b}){a.push({name:"connectorEditor",params:{connectorId:b}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=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.3170e782.js.map
