import{d as y,f1 as b,y as g,b as _,c as w,u as h,fd as I}from"./outputWidgets.abde7be7.js";import{a as k}from"./asyncComputed.e188c84d.js";import{a as x}from"./gateway.e5c93921.js";import"./index.2e366912.js";import{M as n}from"./member.cd96ab58.js";import{C}from"./CrudView.d2e5841c.js";import{a as v}from"./ant-design.039e95cf.js";import"./popupNotifcation.51a8836c.js";import"./record.4adc9d27.js";import"./pubsub.7f579dee.js";import"./router.aff593c1.js";import"./Form.8489fb6d.js";import"./hasIn.b8f131ab.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.2107de83.js";import"./BookOutlined.ef6ccb36.js";import"./url.578d50c3.js";import"./Modal.b9769244.js";import"./index.42ebfb5e.js";import"./index.a7c0b349.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]="78bfcc35-2cf2-4b4a-aa89-e916aea8661b",t._sentryDebugIdIdentifier="sentry-dbid-78bfcc35-2cf2-4b4a-aa89-e916aea8661b")}catch{}})();const Q=y({__name:"Editors",setup(t){const a=b().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=g(()=>{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{Q as default};
//# sourceMappingURL=Editors.2bce86fc.js.map
