import{d as f,eB as b,eA as C,H as g,b as _,c as I,u as h}from"./outputWidgets.12d07fe6.js";import{b as w}from"./index.a1296999.js";import"./router.d820a159.js";import{C as i}from"./connector.28655d0b.js";import{a as k}from"./asyncComputed.4b96df58.js";import{q as x,d as E}from"./icons.f2b4f37f.js";import{C as D}from"./CrudView.1d47b402.js";import"./index.cf4c23b9.js";import"./record.9ee5b79a.js";import"./pubsub.1984cbae.js";import"./FormItem.791863a4.js";import"./hasIn.7e305b7d.js";import"./Paragraph.01fbd56d.js";import"./Base.24118e9f.js";import"./Typography.45a7b8d7.js";import"./Form.a87331b6.js";import"./Modal.f73330d1.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.0bca7c74.js";import"./url.f2a2de62.js";import"./index.04a061be.js";import"./Title.cc650707.js";import"./Text.6b94c3bc.js";import"./index.d055bc8b.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]="860bc66a-3b15-478d-ac8f-24cdd2f1c4be",o._sentryDebugIdIdentifier="sentry-dbid-860bc66a-3b15-478d-ac8f-24cdd2f1c4be")}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.83ae2f96.js.map
