import{C as b}from"./CrudView.1ccf505e.js";import{a as m}from"./ant-design.c69720e9.js";import{a as g}from"./asyncComputed.7c051de7.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.4fd4520f.js";import{a as z}from"./gateway.2e2b2bcf.js";import"./tables.cb9d1914.js";import{M as n}from"./member.2d73db5f.js";import"./router.bb3a61e7.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.50bbaf08.js";import"./BookOutlined.3f1562e1.js";import"./url.d2bb0884.js";import"./PhDotsThree.vue.cfccf254.js";import"./index.b858c0db.js";import"./index.ced107b2.js";import"./popupNotifcation.b3d7898e.js";import"./record.ab5bf640.js";import"./string.3be91b30.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]="d0d35498-50e5-4b32-b912-6dab8c93322d",o._sentryDebugIdIdentifier="sentry-dbid-d0d35498-50e5-4b32-b912-6dab8c93322d")}catch{}})();const P=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,c=[{key:"email",label:"Email"}],l=async e=>{await n.create(r,e.email),d()};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),d())}const{loading:p,result:f,refetch:d}=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:c,onCreate:l},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.f31fe574.js.map
