import{d as y,ez as f,ey as C,H as _,b as g,c as I,u as k}from"./outputWidgets.d6334d0e.js";import{b as w}from"./columns.6b92da60.js";import"./router.c9839d0e.js";import{C as i}from"./connector.4d168ae7.js";import{a as h}from"./asyncComputed.95fd0999.js";import{e as x,k as E}from"./icons.09e1f108.js";import{C as D}from"./CrudView.a040df87.js";import"./gateway.78108c4a.js";import"./activeRecord.aa738a85.js";import"./pubsub.9d7d329e.js";import"./index.f4ac7424.js";import"./Form.afe8a620.js";import"./Title.132c3f7f.js";import"./transButton.97ae4a5a.js";import"./Text.2f6a30da.js";import"./index.85dd1fea.js";import"./url.dce42ecb.js";import"./index.9476b093.js";import"./index.e0fb68fa.js";import"./index.98d66b02.js";import"./index.2221e01c.js";import"./index.6da051f8.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="6578ad2e-ebb2-4aea-ba1c-7ab04d449127",o._sentryDebugIdIdentifier="sentry-dbid-6578ad2e-ebb2-4aea-ba1c-7ab04d449127")}catch{}})();const U=y({__name:"Connectors",setup(o){const a=f(),r=C(),c=a.params.projectId;async function s(e){const t=await i.create(c,e.name,e.type);r.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:d,refetch:l}=h(()=>i.list(c)),u=_(()=>{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:b}){r.push({name:"connectorEditor",params:{connectorId:b}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=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.48e3f611.js.map
