import{d as b,eA as f,ez as C,G as g,b as _,c as I,u as w}from"./outputWidgets.6d6b4a37.js";import{b as h}from"./index.2cafcd9c.js";import"./router.4e9df257.js";import{C as s}from"./connector.08d2de7e.js";import{a as k}from"./asyncComputed.17a6198d.js";import{e as x,g as E}from"./icons.28d0d847.js";import{C as D}from"./CrudView.230a173f.js";import"./record.7835c07e.js";import"./pubsub.7d377b25.js";import"./gateway.7a58b0c8.js";import"./Form.1ff54ed5.js";import"./index.72c317ca.js";import"./index.0e216cc8.js";import"./Title.b41b4f96.js";import"./url.b5fbb423.js";import"./index.9eddb8ae.js";import"./index.6f6e8ffd.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]="d73e303d-fedb-4179-a8bb-91e192d5e987",o._sentryDebugIdIdentifier="sentry-dbid-d73e303d-fedb-4179-a8bb-91e192d5e987")}catch{}})();const K=b({__name:"Connectors",setup(o){const r=f(),a=C(),c=r.params.projectId;async function i(e){const t=await s.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:l,refetch:m}=k(()=>s.list(c)),u=g(()=>{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:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),m()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),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:i},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Connectors.46d46955.js.map
