import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.3f6d0550.js";import{b as h}from"./index.4a6147e4.js";import"./router.f2ffb037.js";import{C as i}from"./connector.e8a4d334.js";import{a as k}from"./asyncComputed.bd80460e.js";import{e as x,q as E}from"./icons.51140278.js";import{C as D}from"./CrudView.7764d20a.js";import"./Title.d85134a2.js";import"./index.3719e3b6.js";import"./activeRecord.4331371e.js";import"./pubsub.0f07f3a4.js";import"./gateway.985e8615.js";import"./index.eb4bb603.js";import"./Form.7ff4c526.js";import"./url.980858d4.js";import"./index.6a58cd86.js";import"./index.9fce520b.js";import"./index.4614c424.js";import"./index.dee2e461.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]="533dca5d-3b4d-4daf-9c9e-2f1ef9154c42",o._sentryDebugIdIdentifier="sentry-dbid-533dca5d-3b4d-4daf-9c9e-2f1ef9154c42")}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.90791759.js.map
