import{C as g}from"./CrudView.f360b43c.js";import{a as d}from"./ant-design.7980fd18.js";import{a as b}from"./asyncComputed.7b5c3427.js";import{d as w,eB as _,eM as h,f as I,o as k,c as v,u as x,eN as C}from"./vue-router.74c693f1.js";import{a as M}from"./gateway.707771fc.js";import"./index.0791082e.js";import{M as n}from"./member.c554032e.js";import"./router.77dea3d2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.97a16843.js";import"./BookOutlined.7a96a9c1.js";import"./url.8b7ee03b.js";import"./index.ad2af8a3.js";import"./index.33768c38.js";import"./popupNotifcation.d39bbf9b.js";import"./record.0d85e3b6.js";import"./string.b1ebfabb.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]="a591bd07-6759-4c37-8fd9-82ac3287a6f5",o._sentryDebugIdIdentifier="sentry-dbid-a591bd07-6759-4c37-8fd9-82ac3287a6f5")}catch{}})();const K=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,l=[{key:"email",label:"Email"}],m=async e=>{await n.create(r,e.email),c()};async function u(e){var t;if(((t=M.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:C,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(k(),v(g,{"entity-name":"editors",loading:x(f),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:l,onCreate:m},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Editors.26a6efb9.js.map
