import{d as f,ey as y,ex as C,F as _,b as g,u as w,bu as I}from"./registerWidgets.6f5be576.js";import{b as h}from"./index.1c2771c5.js";import"./gateway.1c0effff.js";import{C as s}from"./connector.2816b783.js";import{a as k}from"./asyncComputed.ea0bb8a8.js";import{f as x,q as D}from"./icons.b2622455.js";import{C as E}from"./CrudView.81000b9b.js";import"./passwordlessManager.1e2193ad.js";import"./pubsub.1dc45978.js";import"./storage.d8b26e7f.js";import"./activeRecord.eb203c6f.js";import"./DropdownMenu.ecdd2e52.js";import"./Modal.dd94f88f.js";import"./LoadingIndicator.2446cb23.js";import"./lottie.df73e4a1.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]="ebfc706d-6f0b-47b7-91e4-130b0ccebeea",o._sentryDebugIdIdentifier="sentry-dbid-ebfc706d-6f0b-47b7-91e4-130b0ccebeea")}catch{}})();const H=f({__name:"Connectors",setup(o){const n=y(),a=C(),c=n.params.projectId;async function i(e){const t=await s.create(c,e.name,e.type);a.push({name:"connectorEditor",params:{connectorId:t.id}})}const l=[{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:p,result:d,refetch:m}=k(()=>s.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=d.value)==null?void 0:e.map(r=>({key:r.id,cells:[{text:r.name,classes:["centered"]},{text:r.type},{text:"Actions",classes:["centered"],actions:[{icon:x,label:"Edit",onClick({key:b}){a.push({name:"connectorEditor",params:{connectorId:b}})}},{icon:D,label:"Delete",dangerous:!0,async onClick(){await r.delete(),m()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),w(E,{"entity-name":"connector",loading:I(p),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:l,"create-button-text":"Create connector",onCreate:i},null,8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Connectors.9a9a4508.js.map
