import{C as g}from"./CrudView.dfc4572e.js";import{a as d}from"./ant-design.83748870.js";import{a as b}from"./asyncComputed.cef7b9d8.js";import{d as w,ed as _,eq as h,f as I,c as k,u as v,o as x,er as z}from"./vue-router.85c27f05.js";import{a as C}from"./gateway.aa5a907a.js";import{M as n}from"./member.b1f6d6f2.js";import"./tables.8aae1278.js";import"./router.6a11826f.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.2ed94dec.js";import"./BookOutlined.3c422224.js";import"./url.2f0a55dd.js";import"./PhDotsThreeVertical.vue.ceb80819.js";import"./Badge.6a9a7808.js";import"./index.b39fb56f.js";import"./popupNotifcation.db970277.js";import"./record.b6b15302.js";import"./string.76b61cc9.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]="c0457208-502c-417d-883d-521d2c7f9746",o._sentryDebugIdIdentifier="sentry-dbid-c0457208-502c-417d-883d-521d2c7f9746")}catch{}})();const P=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,m=[{key:"email",label:"Email"}],l=async e=>{await n.create(r,e.email),c()};async function u(e){var t;if(((t=C.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:p,result:f,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=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:z,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(x(),k(g,{"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:m,create:l},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.0b98942a.js.map
