import{d as f,eB as y,eA as C,G as _,b as g,c as I,u as w}from"./outputWidgets.0ed3a637.js";import{b as h}from"./columns.15b333c9.js";import"./router.d8af0f7d.js";import{C as i}from"./connector.294b0773.js";import{a as k}from"./asyncComputed.054ae312.js";import{e as x,i as E}from"./icons.8d5441dc.js";import{C as D}from"./CrudView.931c84f7.js";import"./gateway.678b6185.js";import"./activeRecord.e0ef2424.js";import"./pubsub.5dd4605f.js";import"./Base.69739fb7.js";import"./transButton.3ca23b61.js";import"./Text.e89a9af1.js";import"./Title.53f943d2.js";import"./index.230ffe19.js";import"./url.4f7be002.js";import"./index.0f5ee3e7.js";import"./index.feaa4503.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]="180b8fcb-5ef1-4b64-940a-1560b8b80aa8",o._sentryDebugIdIdentifier="sentry-dbid-180b8fcb-5ef1-4b64-940a-1560b8b80aa8")}catch{}})();const L=f({__name:"Connectors",setup(o){const a=y(),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: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:b}){r.push({name:"connectorEditor",params:{connectorId:b}})}},{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{L as default};
//# sourceMappingURL=Connectors.567fae75.js.map
