import{C as b}from"./CrudView.d1e7db37.js";import{a as m}from"./ant-design.48f0098b.js";import{a as g}from"./asyncComputed.fa5d300b.js";import{d as w,eu as _,eH as h,f as I,c as k,u as v,eI as x,o as C}from"./vue-router.92e55c98.js";import{a as z}from"./gateway.7e45c940.js";import"./tables.a988420e.js";import{M as n}from"./member.d26358e3.js";import"./router.366ad4c7.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.57c17db3.js";import"./BookOutlined.e4239f7b.js";import"./url.4183c896.js";import"./PhDotsThree.vue.ea571b99.js";import"./index.bbc1801f.js";import"./index.3468ebf1.js";import"./popupNotifcation.d8a4f6ee.js";import"./record.25f01883.js";import"./string.9a4bb46b.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]="cb7c6349-b584-444b-a8e2-1578c59c33d9",o._sentryDebugIdIdentifier="sentry-dbid-cb7c6349-b584-444b-a8e2-1578c59c33d9")}catch{}})();const P=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,l=[{key:"email",label:"Email"}],d=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 m("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 m("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),c())}const{loading:p,result:f,refetch:c}=g(()=>n.list(r)),y=I(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=f.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(b,{"entity-name":"editors",loading:v(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:l,onCreate:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.bc5d494e.js.map
