import{d as y,ey as b,ex as C,F as _,b as g,u as w,bu as I}from"./registerWidgets.751c4cc6.js";import{b as h}from"./index.1677387f.js";import"./gateway.a29f1b8a.js";import{C as s}from"./connector.2faff8c5.js";import{a as k}from"./asyncComputed.4ba8b2d8.js";import{f as x,q as D}from"./icons.839289ff.js";import{C as E}from"./CrudView.55a91fc3.js";import"./passwordlessManager.8b22003c.js";import"./pubsub.87f27d54.js";import"./storage.fbef8aee.js";import"./activeRecord.91f4e05e.js";import"./DropdownMenu.3730f8d7.js";import"./Modal.2619bb1d.js";import"./LoadingIndicator.e1d41754.js";import"./lottie.2da9cd67.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="f003cf37-4b44-4aa5-813e-ad4d3dfb9ee2",o._sentryDebugIdIdentifier="sentry-dbid-f003cf37-4b44-4aa5-813e-ad4d3dfb9ee2")}catch{}})();const H=y({__name:"Connectors",setup(o){const n=b(),r=C(),c=n.params.projectId;async function i(e){const t=await s.create(c,e.name,e.type);r.push({name:"connectorEditor",params:{connectorId:t.id}})}const d=[{key:"name",label:"Connector name",type:"text"},{key:"type",label:"Connector type",type:Object.entries(h.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:l,result:p,refetch:m}=k(()=>s.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=p.value)==null?void 0:e.map(a=>({key:a.id,cells:[{text:a.name,classes:["centered"]},{text:a.type},{text:"Actions",classes:["centered"],actions:[{icon:x,label:"Edit",onClick({key:f}){r.push({name:"connectorEditor",params:{connectorId:f}})}},{icon:D,label:"Delete",dangerous:!0,async onClick(){await a.delete(),m()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),w(E,{"entity-name":"connector",loading:I(l),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:d,"create-button-text":"Create connector",onCreate:i},null,8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Connectors.fa3b830e.js.map
