import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.b8e3fbc0.js";import{b as h}from"./index.c28e38ab.js";import"./router.c0f681d7.js";import{C as i}from"./connector.931378d8.js";import{a as k}from"./asyncComputed.977b7d3a.js";import{e as x,q as E}from"./icons.4de3900f.js";import{C as D}from"./CrudView.4bacc99a.js";import"./Title.b922ff42.js";import"./index.b9764f4b.js";import"./activeRecord.407da188.js";import"./pubsub.dbd75de9.js";import"./gateway.fb1f3fe6.js";import"./index.364876d6.js";import"./Form.a05787d5.js";import"./url.e34f8e7c.js";import"./index.0e41e755.js";import"./index.4cd7b067.js";import"./index.2ea342e8.js";import"./index.5ca55868.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]="ff1aa860-a230-48da-84f5-fd1c262a6b5a",o._sentryDebugIdIdentifier="sentry-dbid-ff1aa860-a230-48da-84f5-fd1c262a6b5a")}catch{}})();const P=y({__name:"Connectors",setup(o){const a=b(),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(h.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:d,refetch:l}=k(()=>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:f}){r.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=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.36b3a37d.js.map
