import{C as g}from"./CrudView.797f086e.js";import{a as l}from"./ant-design.c0f2ec4c.js";import{a as b}from"./asyncComputed.72143f3b.js";import{d as w,e7 as _,ek as h,f as I,c as k,u as v,el as x,o as C}from"./vue-router.97d0d8a6.js";import{a as z}from"./gateway.91a35dd3.js";import{M as n}from"./member.b372aa93.js";import"./tables.8944c1e2.js";import"./router.bf9d2a86.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.05d4ef76.js";import"./BookOutlined.868baafb.js";import"./url.6a6403b0.js";import"./PhDotsThree.vue.3d83613d.js";import"./index.557e8025.js";import"./popupNotifcation.80047f06.js";import"./record.a84b6d90.js";import"./string.4a3650cc.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]="6a3a7499-a333-4753-bf0c-dc5d913a0956",o._sentryDebugIdIdentifier="sentry-dbid-6a3a7499-a333-4753-bf0c-dc5d913a0956")}catch{}})();const K=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,d=[{key:"email",label:"Email"}],m=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: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:d,onCreate:m},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Editors.01e73799.js.map
