import{d as f,ez as b,ey as C,H as _,b as g,c as I,u as k}from"./outputWidgets.a4629ff8.js";import{b as w}from"./columns.464a3bb5.js";import"./router.ab2ac3ba.js";import{C as i}from"./connector.b5a2e28b.js";import{a as h}from"./asyncComputed.fb8b9ba6.js";import{e as x,k as E}from"./icons.73bff2ab.js";import{C as D}from"./CrudView.a5b1a4eb.js";import"./gateway.68939de7.js";import"./activeRecord.a2b7d343.js";import"./pubsub.25dc8c41.js";import"./index.f4ac7424.js";import"./Title.cf2a531e.js";import"./index.339c7421.js";import"./Text.eb216708.js";import"./Form.ab59726f.js";import"./url.d6a620b9.js";import"./index.874565bb.js";import"./index.48817ebe.js";import"./index.0f6dde5f.js";import"./index.46db6cb2.js";import"./index.56cfba6d.js";import"./index.fda4c602.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]="d2246787-8839-4c8b-ae37-27ff93e68c6b",o._sentryDebugIdIdentifier="sentry-dbid-d2246787-8839-4c8b-ae37-27ff93e68c6b")}catch{}})();const U=f({__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:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{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{U as default};
//# sourceMappingURL=Connectors.35b92381.js.map
