import{d as f,eB as b,eA as C,G as g,b as _,c as I,u as h}from"./outputWidgets.3c34606b.js";import{b as w}from"./index.c3f2d302.js";import"./router.56692652.js";import{C as i}from"./connector.010f86dd.js";import{a as k}from"./asyncComputed.8707f293.js";import{u as x,o as E}from"./icons.e6ec075a.js";import{C as D}from"./CrudView.7c2b0e6f.js";import"./index.cf4c23b9.js";import"./record.c46cf28f.js";import"./pubsub.28c1e0e3.js";import"./FormItem.895a8678.js";import"./hasIn.01f4de81.js";import"./index.dd5bce3f.js";import"./Title.f4855332.js";import"./Text.aa4a1cf1.js";import"./Form.d74c49d4.js";import"./Modal.10b1f4fc.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.36eacc0b.js";import"./url.425cd9cb.js";import"./index.507e77a0.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]="c9fe66c2-c1f4-48d5-97d4-c728c73d9af3",o._sentryDebugIdIdentifier="sentry-dbid-c9fe66c2-c1f4-48d5-97d4-c728c73d9af3")}catch{}})();const Q=f({__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(w.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:d,refetch:l}=k(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"",align:"right"}],rows:(t=(e=d.value)==null?void 0:e.map(n=>({key:n.id,cells:[{type:"link",text:n.name,to:{name:"connectorEditor",params:{connectorId:n.id}}},{type:"text",text:n.type},{type:"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(),l()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),I(D,{"entity-name":"connector",loading:h(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{Q as default};
//# sourceMappingURL=Connectors.79be8323.js.map
