import{d as b,eA as y,H as g,b as _,c as w,u as h,eQ as I}from"./outputWidgets.b2f2adf2.js";import{a as k}from"./asyncComputed.0eb432f7.js";import{b as x}from"./router.778927b3.js";import"./index.914bcef3.js";import{M as n}from"./member.b8a6c7d2.js";import{C}from"./CrudView.5c233833.js";import{a as v}from"./ant-design.c95e6c48.js";import"./Form.151a806c.js";import"./hasIn.2f264b73.js";import"./popupNotifcation.45645a97.js";import"./index.cf4c23b9.js";import"./record.01220836.js";import"./pubsub.56b36b75.js";import"./Paragraph.038d3c4a.js";import"./Text.9554a64b.js";import"./Modal.29dbfea8.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.204f99fb.js";import"./BookOutlined.312749b0.js";import"./url.de379c40.js";import"./index.c47b0dc1.js";import"./Title.d1ce9cd1.js";import"./index.0f294ac7.js";import"./index.239ed389.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]="c2a9a698-5eab-4be6-9559-9b590f11ab95",t._sentryDebugIdIdentifier="sentry-dbid-c2a9a698-5eab-4be6-9559-9b590f11ab95")}catch{}})();const W=b({__name:"Editors",setup(t){const a=y().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{W as default};
//# sourceMappingURL=Editors.b81b6c15.js.map
