import{C as b}from"./CrudView.c3cfdbe0.js";import{a as m}from"./ant-design.8d54eea4.js";import{a as g}from"./asyncComputed.492220e2.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.c5124aea.js";import{a as C}from"./gateway.f0a8a4c2.js";import{M as n}from"./member.5f10a588.js";import"./tables.e3d4a0cb.js";import"./router.09f8c7fd.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.ee60e4e5.js";import"./BookOutlined.4a8c6e69.js";import"./url.a882d197.js";import"./PhDotsThreeVertical.vue.db7af6ac.js";import"./Badge.2abe7f2d.js";import"./index.31f5d814.js";import"./popupNotifcation.13f7057e.js";import"./record.3c40de6b.js";import"./string.243c4431.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]="f160dc98-9f42-4a0e-bb85-212b8b8e1480",o._sentryDebugIdIdentifier="sentry-dbid-f160dc98-9f42-4a0e-bb85-212b8b8e1480")}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=C.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:f,result:p,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=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:z,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(x(),k(b,{"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,create:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.f446fc36.js.map
