import{d as y,eA as g,H as b,b as _,c as w,u as h,eQ as I}from"./outputWidgets.67d01534.js";import{a as k}from"./asyncComputed.9c2e7c90.js";import{b as x}from"./router.da0efacf.js";import"./index.af8a2c28.js";import{M as n}from"./member.206cf662.js";import{C}from"./CrudView.d78585d4.js";import{a as v}from"./ant-design.11897fd2.js";import"./Form.18143f38.js";import"./hasIn.18867aca.js";import"./popupNotifcation.48a418fa.js";import"./index.cf4c23b9.js";import"./record.97ce606c.js";import"./pubsub.ce0b10ac.js";import"./Paragraph.5d6efe5b.js";import"./Text.fce07a64.js";import"./Modal.e44b2640.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.00cfbae2.js";import"./BookOutlined.93eb4c42.js";import"./url.df413b89.js";import"./index.3dca3a8f.js";import"./Title.3431c309.js";import"./index.378e6c26.js";import"./index.0614ab03.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]="13bd0a15-2ae3-4126-a9c4-7100896566d3",t._sentryDebugIdIdentifier="sentry-dbid-13bd0a15-2ae3-4126-a9c4-7100896566d3")}catch{}})();const W=y({__name:"Editors",setup(t){const a=g().params.organizationId,l=[{key:"email",label:"Email"}],d=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 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:()=>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:l,onCreate:d},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.e69eeee4.js.map
