import{C as b}from"./CrudView.f04f853e.js";import{a as c}from"./ant-design.f29af77f.js";import{a as g}from"./asyncComputed.95993e52.js";import{d as w,eB as _,eO as h,f as I,c as k,u as v,eP as x,o as C}from"./vue-router.78d58ff0.js";import{a as z}from"./gateway.3d93841d.js";import"./tables.aed54935.js";import{M as n}from"./member.81e254a7.js";import"./router.ce687edb.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.c6ea29d9.js";import"./BookOutlined.238416cb.js";import"./url.f92f4d36.js";import"./PhDotsThree.vue.4c71ca22.js";import"./index.8e2351ec.js";import"./index.e96c19f7.js";import"./popupNotifcation.466d80c0.js";import"./record.6c05e3f5.js";import"./string.b574f1fa.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]="80b67354-74e1-4c93-b104-7f356eb83657",o._sentryDebugIdIdentifier="sentry-dbid-80b67354-74e1-4c93-b104-7f356eb83657")}catch{}})();const K=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),m()};async function u(e){var t;if(((t=z.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),m())}const{loading:p,result:f,refetch:m}=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{K as default};
//# sourceMappingURL=Editors.4be424fb.js.map
