import{C as g}from"./CrudView.378604b7.js";import{a as m}from"./ant-design.bd1e0c93.js";import{a as b}from"./asyncComputed.7bba19c4.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.7c54f186.js";import{a as C}from"./gateway.237dc814.js";import{M as n}from"./member.7356b766.js";import"./tables.cf58d279.js";import"./router.a775a43a.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.bc4a06b6.js";import"./BookOutlined.81ff85ee.js";import"./url.d360a955.js";import"./PhDotsThreeVertical.vue.4809a79b.js";import"./Badge.65b9586f.js";import"./index.24ee95d7.js";import"./popupNotifcation.88833623.js";import"./record.a7963f98.js";import"./string.8ee1f1e3.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]="572e55cf-06f5-401e-ad5a-534c95a3ca79",o._sentryDebugIdIdentifier="sentry-dbid-572e55cf-06f5-401e-ad5a-534c95a3ca79")}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}=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:l,create:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.243c24f8.js.map
