import{d as b,eB as f,eA as C,H as g,b as _,c as I,u as h}from"./outputWidgets.a3cf86d4.js";import{b as w}from"./index.d3453ff4.js";import"./router.7ac4af4b.js";import{C as i}from"./connector.1ad6abd0.js";import{a as k}from"./asyncComputed.1cc21e38.js";import{H as x,i as E}from"./icons.71dd468a.js";import{C as D}from"./CrudView.f083926d.js";import"./index.cf4c23b9.js";import"./record.284ed593.js";import"./pubsub.f3afa6c4.js";import"./Form.48a2d714.js";import"./hasIn.c81db0e4.js";import"./Paragraph.d0378343.js";import"./Base.438220fe.js";import"./Typography.2d337449.js";import"./Modal.a36dd52c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7f8bc1c2.js";import"./url.eef7d5cb.js";import"./index.3c8fbafb.js";import"./Title.abc37adf.js";import"./Text.c33f164a.js";import"./index.1c110c61.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]="3c3e967c-db45-4a33-906e-b9dc577ede91",o._sentryDebugIdIdentifier="sentry-dbid-3c3e967c-db45-4a33-906e-b9dc577ede91")}catch{}})();const U=b({__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: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{U as default};
//# sourceMappingURL=Connectors.be3c7e8c.js.map
