import{d as y,eA as b,ez as C,J as _,b as g,c as I,u as w}from"./outputWidgets.f120b477.js";import{b as h}from"./index.81859a03.js";import"./router.e3ecb487.js";import{C as i}from"./connector.f6b358cd.js";import{a as k}from"./asyncComputed.5ccd4614.js";import{e as x,q as E}from"./icons.c367c256.js";import{C as D}from"./CrudView.87b341af.js";import"./Title.3dc4e32d.js";import"./index.5818bfb2.js";import"./activeRecord.d87d7ef2.js";import"./pubsub.4681462f.js";import"./gateway.a36b7b3a.js";import"./index.3ab4f365.js";import"./Form.ec892c10.js";import"./url.8af07297.js";import"./index.b96fbbd8.js";import"./index.3801d49d.js";import"./index.de46e6db.js";import"./index.54e8798a.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]="1733aef3-21f6-46a7-83bc-bd6d9963b1d1",o._sentryDebugIdIdentifier="sentry-dbid-1733aef3-21f6-46a7-83bc-bd6d9963b1d1")}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:d,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(d),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.39eec9af.js.map
