import{d as y,f1 as g,y as b,b as _,c as w,u as h,fd as I}from"./outputWidgets.9e7bd3a6.js";import{a as k}from"./asyncComputed.fb556333.js";import{a as x}from"./gateway.8fcf86ab.js";import"./index.d38a0669.js";import{M as n}from"./member.7fd328a4.js";import{C}from"./CrudView.6565f625.js";import{a as v}from"./ant-design.c2ad2929.js";import"./popupNotifcation.24d18d49.js";import"./record.dce94ddc.js";import"./pubsub.f3af3eeb.js";import"./string.6d0759d4.js";import"./router.27283135.js";import"./Form.dfca34ad.js";import"./hasIn.35808092.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.548b5f6c.js";import"./BookOutlined.5c7ce856.js";import"./url.1f5e31bf.js";import"./Modal.41211848.js";import"./index.a28fbaa6.js";import"./index.3b896d2d.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]="56abada4-7d1d-4875-82d5-911e24af6ad3",t._sentryDebugIdIdentifier="sentry-dbid-56abada4-7d1d-4875-82d5-911e24af6ad3")}catch{}})();const S=y({__name:"Editors",setup(t){const a=g().params.organizationId,m=[{key:"email",label:"Email"}],l=async e=>{await n.create(a,e.email),s()};async function c(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 d;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((d=x.getAuthor())==null?void 0:d.claims.email)===o.email?[]:[{icon:I,label:"Remove access",onClick:()=>c(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:m,onCreate:l},null,8,["loading","table"]))}});export{S as default};
//# sourceMappingURL=Editors.1f2e5c49.js.map
