import{C as b}from"./CrudView.570bcf8e.js";import{a as c}from"./ant-design.6269686d.js";import{a as g}from"./asyncComputed.5fa11bed.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.c536fc2b.js";import{a as z}from"./gateway.c0087c9f.js";import{M as n}from"./member.6d281982.js";import"./tables.6d634a71.js";import"./router.a06a6246.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f8595ff8.js";import"./BookOutlined.4a409157.js";import"./url.4c149b5f.js";import"./PhDotsThree.vue.605843a4.js";import"./index.a489f9a1.js";import"./popupNotifcation.188e9011.js";import"./record.f45db9bc.js";import"./string.faa727da.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]="68f7bcef-9d99-4fb9-a3ab-29b37f212534",o._sentryDebugIdIdentifier="sentry-dbid-68f7bcef-9d99-4fb9-a3ab-29b37f212534")}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),l()};async function u(e){var t;if(((t=z.getAuthor())==null?void 0:t.claims.email)===e.email&&await c("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 c("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),l())}const{loading:f,result:p,refetch:l}=g(()=>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(b,{"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:d},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Editors.37a7a027.js.map
