import{d as y,eB as f,eA as C,H as g,b as I,c as _,u as h}from"./outputWidgets.c8053a9d.js";import{b as w}from"./index.7b750cfc.js";import"./router.c5eb5658.js";import{C as i}from"./connector.a4ed072a.js";import{a as k}from"./asyncComputed.f7e207a4.js";import{I as x,i as E}from"./icons.9e4059c8.js";import{C as D}from"./CrudView.81651cd0.js";import"./index.cf4c23b9.js";import"./record.c60a7475.js";import"./pubsub.231a79a7.js";import"./Form.034d9295.js";import"./hasIn.7ae70fa0.js";import"./popupNotifcation.b87aeac6.js";import"./Paragraph.68b1de18.js";import"./Base.d9fc6eef.js";import"./Typography.e5f51e32.js";import"./Modal.63744d77.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f912e8a7.js";import"./url.d8c088a2.js";import"./index.5905e3dd.js";import"./Title.ed86be86.js";import"./Text.d464b589.js";import"./index.b514db2b.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]="88a4d7bf-b0f4-4d0a-b3b0-a0825c2bccd4",o._sentryDebugIdIdentifier="sentry-dbid-88a4d7bf-b0f4-4d0a-b3b0-a0825c2bccd4")}catch{}})();const W=y({__name:"Connectors",setup(o){const r=f(),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:b}){a.push({name:"connectorEditor",params:{connectorId:b}})}},{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.a71a6964.js.map
