import{C as g}from"./CrudView.d77e910d.js";import{a as d}from"./ant-design.48d4c5e3.js";import{a as b}from"./asyncComputed.bb3077bb.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.5e8ba7eb.js";import{a as z}from"./gateway.9bb9fef7.js";import{M as n}from"./member.1f7eb939.js";import"./tables.8dccf3c7.js";import"./router.1e5228d6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.af476096.js";import"./BookOutlined.bf415405.js";import"./url.4683fc99.js";import"./PhDotsThree.vue.5061c9cb.js";import"./index.d0fd73d7.js";import"./index.806e571e.js";import"./popupNotifcation.b3ef9d8a.js";import"./record.98df87df.js";import"./string.3bd1e390.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]="33eff055-d106-48d0-9cd5-fc444b27626a",o._sentryDebugIdIdentifier="sentry-dbid-33eff055-d106-48d0-9cd5-fc444b27626a")}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=z.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:x,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(C(),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,onCreate:l},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.3ee95079.js.map
