import{d as y,eB as g,H as b,b as _,c as w,u as h,eP as I}from"./outputWidgets.b1e87772.js";import{a as k}from"./asyncComputed.5830bf45.js";import{b as x}from"./router.a9e5af79.js";import"./index.f89d635d.js";import{M as n}from"./member.99ea3ed3.js";import{C}from"./CrudView.cde29d2c.js";import{a as v}from"./ant-design.baebef5b.js";import"./Form.c64de99c.js";import"./hasIn.443af95b.js";import"./popupNotifcation.6e758e81.js";import"./index.cf4c23b9.js";import"./record.2f552fbf.js";import"./pubsub.8b7604ff.js";import"./Paragraph.72ff08f3.js";import"./Text.a2ac66f5.js";import"./Modal.6f2aaf4e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.370ccd6b.js";import"./url.105c4f84.js";import"./index.fae832ba.js";import"./Title.87ff1f7b.js";import"./index.78c9c56d.js";import"./index.0a49c5ca.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="2796c67a-3a69-47dc-8540-e56603b7aa66",t._sentryDebugIdIdentifier="sentry-dbid-2796c67a-3a69-47dc-8540-e56603b7aa66")}catch{}})();const U=y({__name:"Editors",setup(t){const a=g().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(a,e.email),s()};async function d(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),s())}const{loading:p,result:u,refetch:s}=k(()=>n.list(a)),f=b(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=u.value)==null?void 0:e.map(o=>{var m;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((m=x.getAuthor())==null?void 0:m.claims.email)===o.email?[]:[{icon:I,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?i:[]}});return(e,i)=>(_(),w(C,{"entity-name":"editors",loading:h(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:f.value,"create-button-text":"Add editors",fields:l,onCreate:c},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Editors.e7cf32a3.js.map
