import{d as y,eB as b,eA as C,H as g,b as _,c as I,u as h}from"./outputWidgets.bb2f46e4.js";import{b as w}from"./index.1bde37fc.js";import"./router.00bad958.js";import{C as i}from"./connector.45cac957.js";import{a as k}from"./asyncComputed.8bd59622.js";import{t as x,o as E}from"./icons.94ad51fe.js";import{C as D}from"./CrudView.14583dec.js";import"./index.cf4c23b9.js";import"./record.dd66f38b.js";import"./pubsub.9e4f8bfd.js";import"./FormItem.744edb5b.js";import"./hasIn.9a8a8af5.js";import"./Paragraph.c54bf5b6.js";import"./Base.3e5c9785.js";import"./Form.fe337595.js";import"./Modal.6f9d473d.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.aaad4840.js";import"./url.1b83203f.js";import"./index.77677488.js";import"./Title.85b45f4d.js";import"./Text.3cea9169.js";import"./index.38894597.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]="aff2809f-2e6e-4ef1-916e-b6961615d68a",o._sentryDebugIdIdentifier="sentry-dbid-aff2809f-2e6e-4ef1-916e-b6961615d68a")}catch{}})();const U=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(w.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:l,refetch:d}=k(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"",align:"right"}],rows:(t=(e=l.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:f}){a.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=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{U as default};
//# sourceMappingURL=Connectors.c4ba70d6.js.map
