import{d as y,f1 as g,y as b,b as _,c as w,u as h,fd as I}from"./outputWidgets.a6a6ef30.js";import{a as k}from"./asyncComputed.d67c847a.js";import{a as x}from"./gateway.c2265f5e.js";import"./index.ac4494b9.js";import{M as n}from"./member.4d3f4404.js";import{C}from"./CrudView.f10a7446.js";import{a as v}from"./ant-design.4d8697aa.js";import"./popupNotifcation.ce8f3816.js";import"./record.8f173599.js";import"./pubsub.906f7e66.js";import"./string.d812720a.js";import"./router.36169449.js";import"./Form.766fb35b.js";import"./hasIn.b01cfd56.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.92a302a6.js";import"./BookOutlined.90e1581d.js";import"./url.00089ca9.js";import"./Modal.c1c6172f.js";import"./index.30ac913e.js";import"./index.43d7170a.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]="f726ef08-f6dc-4f55-aa12-aba86cc71683",t._sentryDebugIdIdentifier="sentry-dbid-f726ef08-f6dc-4f55-aa12-aba86cc71683")}catch{}})();const S=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:f,result:p,refetch:s}=k(()=>n.list(a)),u=b(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=p.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(f),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:u.value,"create-button-text":"Add editors",fields:l,onCreate:c},null,8,["loading","table"]))}});export{S as default};
//# sourceMappingURL=Editors.0839c12f.js.map
