import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.cf5b7366.js";import{b as h}from"./index.2fa55c7c.js";import"./router.565b4739.js";import{C as i}from"./connector.5b1868db.js";import{a as k}from"./asyncComputed.2caa7fe6.js";import{e as x,q as E}from"./icons.c510a141.js";import{C as D}from"./CrudView.ca1846b4.js";import"./Title.adce1298.js";import"./index.3d2fbf9e.js";import"./activeRecord.f30e02c2.js";import"./pubsub.664a70af.js";import"./gateway.409ff644.js";import"./index.7622dd54.js";import"./Form.c8affe88.js";import"./url.fb40e08c.js";import"./index.47f17eed.js";import"./index.aee8b5d5.js";import"./index.9583d9e9.js";import"./index.10cdfb2c.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]="4554829a-e7d5-4f8b-8d22-1de91d720ef5",o._sentryDebugIdIdentifier="sentry-dbid-4554829a-e7d5-4f8b-8d22-1de91d720ef5")}catch{}})();const P=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 d=[{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:p,result:m,refetch:l}=k(()=>i.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=m.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)=>(g(),I(D,{"entity-name":"connector",loading:w(p),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:d,"create-button-text":"Create connector",onCreate:s},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Connectors.0b2c7168.js.map
