import{C as g}from"./CrudView.00ba8ddf.js";import{a as d}from"./ant-design.02104fdb.js";import{a as b}from"./asyncComputed.5aa790b6.js";import{d as w,e7 as _,ek as h,f as I,c as k,u as v,el as x,o as C}from"./vue-router.d9feb5a3.js";import{a as z}from"./gateway.bcb6c1cd.js";import{M as n}from"./member.7f006530.js";import"./tables.97f7d64d.js";import"./router.3320320c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7780e068.js";import"./BookOutlined.06277ca0.js";import"./url.99c6614b.js";import"./PhDotsThreeVertical.vue.83d724ac.js";import"./index.3ceffa89.js";import"./popupNotifcation.326ad4ba.js";import"./record.6cf0986e.js";import"./string.c0b64362.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]="4f15d8d4-2c26-4ac3-8c66-c33a5e26ed4f",o._sentryDebugIdIdentifier="sentry-dbid-4f15d8d4-2c26-4ac3-8c66-c33a5e26ed4f")}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),c()};async function u(e){var t;if(((t=z.getAuthor())==null?void 0:t.claims.email)===e.email&&await d("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 d("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),c())}const{loading:f,result:p,refetch:c}=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:x,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(C(),k(g,{"entity-name":"editors",loading:v(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.dd46f498.js.map
