import{d as b,eB as f,eA as C,H as g,b as I,c as _,u as h}from"./outputWidgets.8c60f264.js";import{b as w}from"./index.cefba0be.js";import"./router.73027db0.js";import{C as c}from"./connector.27efac2b.js";import{a as k}from"./asyncComputed.ec57bff0.js";import{I as x,i as E}from"./icons.a1b2387c.js";import{C as D}from"./CrudView.dddbc266.js";import"./index.cf4c23b9.js";import"./record.12e29287.js";import"./pubsub.e2873ec1.js";import"./Form.59d8a79a.js";import"./hasIn.2571917b.js";import"./popupNotifcation.9fb65665.js";import"./Paragraph.6e41b767.js";import"./Base.39a7265d.js";import"./Typography.7f982c9c.js";import"./Modal.bbbfe3c8.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e0bea090.js";import"./url.446977b6.js";import"./index.251ea9f5.js";import"./Title.49f2815e.js";import"./Text.06b5e1a7.js";import"./index.449fb202.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]="e7675e6d-8482-4840-8bde-e9586ed59b19",o._sentryDebugIdIdentifier="sentry-dbid-e7675e6d-8482-4840-8bde-e9586ed59b19")}catch{}})();const W=b({__name:"Connectors",setup(o){const r=f(),a=C(),i=r.params.projectId;async function s(e){const t=await c.create(i,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(()=>c.list(i)),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.e8bc4b9c.js.map
