import{C as g}from"./CrudView.cf2efa85.js";import{a as d}from"./ant-design.9176bfec.js";import{a as b}from"./asyncComputed.c066d666.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.e2dfd848.js";import{a as C}from"./gateway.9d624aa1.js";import{M as n}from"./member.ef2dc6ff.js";import"./tables.ce119705.js";import"./router.4083831b.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9bf7a4fd.js";import"./BookOutlined.dcf239a2.js";import"./url.55d7f2ef.js";import"./PhDotsThreeVertical.vue.a2a5846d.js";import"./Badge.d1042aea.js";import"./index.7b491e18.js";import"./popupNotifcation.367e10ac.js";import"./record.228e1a8a.js";import"./string.6557d1ac.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]="573ab98c-8d79-4ac8-95e2-ff8d42644f2d",o._sentryDebugIdIdentifier="sentry-dbid-573ab98c-8d79-4ac8-95e2-ff8d42644f2d")}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:f,result:p,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=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(g,{"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:m,create:l},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.6047012f.js.map
