import{C as g}from"./CrudView.3cb1fb74.js";import{a as c}from"./ant-design.5377a580.js";import{a as b}from"./asyncComputed.0b7f3eaf.js";import{d as w,eA as _,eM as h,f as I,o as k,c as v,u as x,eN as C}from"./vue-router.637ad36e.js";import{a as M}from"./gateway.e1c89e24.js";import"./tables.0c659977.js";import{M as n}from"./member.32a75069.js";import"./router.3a426b39.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9833e445.js";import"./BookOutlined.c02a6591.js";import"./url.c1cbace3.js";import"./index.ba283bad.js";import"./index.faf7cd82.js";import"./popupNotifcation.498cf509.js";import"./record.833ab838.js";import"./string.876500c9.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="bdd3d518-f2eb-4314-8a49-67f5c951ad03",o._sentryDebugIdIdentifier="sentry-dbid-bdd3d518-f2eb-4314-8a49-67f5c951ad03")}catch{}})();const K=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,l=[{key:"email",label:"Email"}],m=async e=>{await n.create(r,e.email),d()};async function u(e){var t;if(((t=M.getAuthor())==null?void 0:t.claims.email)===e.email&&await c("You are about to remove your own access. You won't be able to access this organization anymore. Are you sure?")){await n.delete(r,e.authorId),await s.push({name:"organizations"});return}await c("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),d())}const{loading:f,result:p,refetch:d}=b(()=>n.list(r)),y=I(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=p.value)==null?void 0:e.map(t=>({key:t.email,cells:[{type:"text",text:t.email},{type:"text",text:t.role},{type:"actions",actions:[{icon:C,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(k(),v(g,{"entity-name":"editors",loading:x(f),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:l,onCreate:m},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Editors.509accd7.js.map
