import{d as f,eB as b,eA as C,H as g,b as _,c as h,u as w,eP as I}from"./outputWidgets.f017b1ba.js";import{b as k}from"./index.2d300106.js";import"./router.bd5e0bcd.js";import{C as i}from"./connector.534f1df5.js";import{a as x}from"./asyncComputed.9ec0ae7d.js";import{G as E}from"./PhPencil.vue.5c3890c6.js";import{C as D}from"./CrudView.ab7e0ba9.js";import"./index.cf4c23b9.js";import"./record.e2bcfa5f.js";import"./pubsub.4d72db7b.js";import"./Form.c4ae4d63.js";import"./hasIn.a2b4c2f9.js";import"./popupNotifcation.d47f45e7.js";import"./Paragraph.3ffb559e.js";import"./Base.bb2b5283.js";import"./Typography.5dfc411f.js";import"./Modal.334f8812.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.377064a4.js";import"./url.42b30a4e.js";import"./index.5cbbe314.js";import"./Title.4002b692.js";import"./Text.01ac3fdf.js";import"./index.b5d890a4.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]="a9b68fcb-6142-45cc-93cf-779794996394",o._sentryDebugIdIdentifier="sentry-dbid-a9b68fcb-6142-45cc-93cf-779794996394")}catch{}})();const U=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(k.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:l,refetch:d}=x(()=>i.list(c)),u=g(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"",align:"right"}],rows:(t=(e=l.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:E,label:"Edit",onClick({key:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:I,label:"Delete",dangerous:!0,async onClick(){await n.delete(),d()}}]}]})))!=null?t:[]}});return(e,t)=>(_(),h(D,{"entity-name":"connector",loading:w(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.05c5ad02.js.map
