import{C as g}from"./CrudView.426bc79f.js";import{a as l}from"./ant-design.d4f59efc.js";import{a as b}from"./asyncComputed.0c2e75f9.js";import{d as w,ed as _,eq as h,f as I,c as k,u as v,o as x,er as C}from"./vue-router.4a8a3251.js";import{a as z}from"./gateway.8fe65dcb.js";import{M as n}from"./member.4276e668.js";import"./tables.fc036ba1.js";import"./router.306a90e5.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.167ba099.js";import"./BookOutlined.302f99d5.js";import"./url.11181b9e.js";import"./PhDotsThreeVertical.vue.ccd7c778.js";import"./index.81074c92.js";import"./popupNotifcation.d430940c.js";import"./record.2a0e778d.js";import"./string.26e1c29c.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]="e73663ce-1466-41a1-923b-963d8405ae4e",o._sentryDebugIdIdentifier="sentry-dbid-e73663ce-1466-41a1-923b-963d8405ae4e")}catch{}})();const K=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,m=[{key:"email",label:"Email"}],d=async e=>{await n.create(r,e.email),c()};async function u(e){var t;if(((t=z.getAuthor())==null?void 0:t.claims.email)===e.email&&await l("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 l("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:C,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,onCreate:d},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Editors.425ea6d6.js.map
