import{d as f,eB as b,eA as C,H as g,b as I,c as _,u as h}from"./outputWidgets.9bb29762.js";import{b as w}from"./index.2f604abe.js";import"./router.f15646c4.js";import{C as i}from"./connector.02e9574a.js";import{a as k}from"./asyncComputed.ac1a0197.js";import{I as x,i as E}from"./icons.d08bf04b.js";import{C as D}from"./CrudView.8ffa6c50.js";import"./index.cf4c23b9.js";import"./record.dd7b0559.js";import"./pubsub.90d4935e.js";import"./Form.472b1af8.js";import"./hasIn.fa8167cd.js";import"./popupNotifcation.b12790e0.js";import"./Paragraph.9dbf4710.js";import"./Base.abff5e35.js";import"./Typography.184e8c0b.js";import"./Modal.8f9ba470.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.79f00877.js";import"./url.c222fac4.js";import"./index.fcc99b17.js";import"./Title.b342fcc9.js";import"./Text.5324981a.js";import"./index.b2ab466e.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]="78d246d3-77dc-4f2e-b765-29410c2fa9b0",o._sentryDebugIdIdentifier="sentry-dbid-78d246d3-77dc-4f2e-b765-29410c2fa9b0")}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: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{W as default};
//# sourceMappingURL=Connectors.466b9084.js.map
