import{d as b,eA as y,H as g,b as _,c as w,u as h,eP as I}from"./outputWidgets.3681a2a5.js";import{a as k}from"./asyncComputed.317e87c5.js";import{b as x}from"./router.ef5c7692.js";import"./index.63f126f8.js";import{M as n}from"./member.d3bac61c.js";import{C}from"./CrudView.b5e99bd9.js";import{a as v}from"./ant-design.2fd7d10a.js";import"./Form.c15ea82d.js";import"./hasIn.127ddf2a.js";import"./popupNotifcation.d8032226.js";import"./index.cf4c23b9.js";import"./record.220fa006.js";import"./pubsub.916b1e4d.js";import"./Paragraph.326f3875.js";import"./Text.1bf2a6e4.js";import"./Modal.7229d3ef.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.b3245b51.js";import"./BookOutlined.2d246e57.js";import"./url.ec571b6b.js";import"./index.4f6b4519.js";import"./Title.142e78f1.js";import"./index.f44ff305.js";import"./index.567558aa.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]="efb1afc1-3ed9-4c35-b2fb-c499ccb3e9c8",t._sentryDebugIdIdentifier="sentry-dbid-efb1afc1-3ed9-4c35-b2fb-c499ccb3e9c8")}catch{}})();const W=b({__name:"Editors",setup(t){const a=y().params.organizationId,c=[{key:"email",label:"Email"}],l=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:c,onCreate:l},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.71ca25fc.js.map
