import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.dcbaec6c.js";import{b as h}from"./index.2b422cbf.js";import"./router.fe36cb8d.js";import{C as i}from"./connector.30c0780a.js";import{a as k}from"./asyncComputed.05eefdbd.js";import{e as x,q as E}from"./icons.eaf14b7d.js";import{C as D}from"./CrudView.4ac6b440.js";import"./Title.137468a8.js";import"./index.678801af.js";import"./activeRecord.d9292c93.js";import"./pubsub.999268d8.js";import"./gateway.f4357ae1.js";import"./index.9fcba2ca.js";import"./Form.94b2db91.js";import"./url.5c03711e.js";import"./index.69bd7c01.js";import"./index.12134aed.js";import"./index.87a757a5.js";import"./index.a56c5205.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]="5a1c9a14-c959-4fcc-8964-f5f26eb1000b",o._sentryDebugIdIdentifier="sentry-dbid-5a1c9a14-c959-4fcc-8964-f5f26eb1000b")}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 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=_(()=>{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:f}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=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.bc4ef6bc.js.map
