import{C as g}from"./CrudView.89b2d509.js";import{a as m}from"./ant-design.eb31b6e2.js";import{a as b}from"./asyncComputed.f77117da.js";import{d as w,eu as _,eH as h,f as I,c as k,u as v,eI as x,o as C}from"./vue-router.6a68d184.js";import{a as z}from"./gateway.46301256.js";import{M as n}from"./member.4e0676c1.js";import"./tables.97d8f468.js";import"./router.2b01b91e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7a74a897.js";import"./BookOutlined.12518a78.js";import"./url.dbab9c15.js";import"./PhDotsThree.vue.d10fe455.js";import"./index.f7061722.js";import"./index.4be87654.js";import"./popupNotifcation.782e5078.js";import"./record.048ae4ac.js";import"./string.1c036a5c.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]="41cc95a1-115b-4f46-a889-1ba9a5480630",o._sentryDebugIdIdentifier="sentry-dbid-41cc95a1-115b-4f46-a889-1ba9a5480630")}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=z.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: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:x,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(C(),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:l,onCreate:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.238c68f1.js.map
