import{C as g}from"./CrudView.edc95542.js";import{a as l}from"./ant-design.3c955d65.js";import{a as b}from"./asyncComputed.6438c00c.js";import{d as w,eB as _,eN as h,f as I,o as k,c as v,u as x,eO as C}from"./vue-router.b2844dbd.js";import{a as z}from"./gateway.635f7051.js";import"./tables.d81eb6d0.js";import{M as n}from"./member.b934206c.js";import"./router.b69b216e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.5f8c56bd.js";import"./BookOutlined.f244a583.js";import"./url.c5aa13f6.js";import"./index.783418dc.js";import"./index.a19b8d23.js";import"./popupNotifcation.6c1732c5.js";import"./record.d017e1a2.js";import"./string.6a4d30e3.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]="36e094d0-a3d2-4e37-960e-63f21d3a28ff",o._sentryDebugIdIdentifier="sentry-dbid-36e094d0-a3d2-4e37-960e-63f21d3a28ff")}catch{}})();const K=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,m=[{key:"email",label:"Email"}],c=async e=>{await n.create(r,e.email),d()};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),d())}const{loading:f,result:p,refetch:d}=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:C,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(k(),v(g,{"entity-name":"editors",loading:x(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:c},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Editors.a30e0afe.js.map
