import{d as f,eB as b,eA as C,H as g,b as _,c as I,u as h}from"./outputWidgets.84400f3d.js";import{b as w}from"./index.575f21cf.js";import"./router.6e29c40f.js";import{C as i}from"./connector.46e923ae.js";import{a as k}from"./asyncComputed.f2a51feb.js";import{H as x,i as E}from"./icons.51c500b8.js";import{C as D}from"./CrudView.ff2ba196.js";import"./index.cf4c23b9.js";import"./record.a1f907ea.js";import"./pubsub.87032f37.js";import"./Form.d05a1b22.js";import"./hasIn.bbea906d.js";import"./popupNotifcation.d06c16fd.js";import"./Paragraph.4b47bceb.js";import"./Base.5abbd37f.js";import"./Typography.d06ce724.js";import"./Modal.d808afee.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.6b27b5c3.js";import"./url.32b2d17f.js";import"./index.fa6ccec8.js";import"./Title.77255753.js";import"./Text.471d0d00.js";import"./index.f01295b9.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]="ff669aba-537d-4bf4-b08d-9e1c0b2531ee",o._sentryDebugIdIdentifier="sentry-dbid-ff669aba-537d-4bf4-b08d-9e1c0b2531ee")}catch{}})();const W=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: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:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{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{W as default};
//# sourceMappingURL=Connectors.80a42ede.js.map
