import{d as y,eE as g,J as b,b as _,c as w,u as h,eS as I}from"./outputWidgets.eb498848.js";import{a as k}from"./asyncComputed.6b2a5298.js";import{b as x}from"./router.dc5374c0.js";import"./index.38387dc8.js";import{M as n}from"./member.3e765f16.js";import{C}from"./CrudView.c7c3d33a.js";import{a as v}from"./ant-design.202cf9c9.js";import"./Form.bd9a7b94.js";import"./hasIn.ceb11556.js";import"./popupNotifcation.1234df84.js";import"./record.7cc6fca0.js";import"./pubsub.1ca1fb40.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.083d7014.js";import"./BookOutlined.d5ff4087.js";import"./url.1d686ce1.js";import"./Paragraph.82d8120c.js";import"./Base.60455d70.js";import"./Modal.19adabd3.js";import"./index.60acdd5f.js";import"./Title.ef0a0830.js";import"./Text.c3630863.js";import"./index.98ba73a6.js";import"./index.052e9e26.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]="d272dac3-6e54-44c4-9406-fc765c7f14ab",t._sentryDebugIdIdentifier="sentry-dbid-d272dac3-6e54-44c4-9406-fc765c7f14ab")}catch{}})();const W=y({__name:"Editors",setup(t){const a=g().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=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:c,onCreate:l},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.20778daa.js.map
