import{d as y,eE as b,J as g,b as _,c as w,u as h,eS as I}from"./outputWidgets.2c936b33.js";import{a as k}from"./asyncComputed.b227690c.js";import{b as x}from"./router.9a76cc66.js";import"./index.bd2be0a2.js";import{M as n}from"./member.d0e3fbae.js";import{C}from"./CrudView.b9ba563d.js";import{a as v}from"./ant-design.06d71579.js";import"./Form.b5e24132.js";import"./hasIn.85b27717.js";import"./popupNotifcation.a42892dc.js";import"./record.210736c4.js";import"./pubsub.4c454988.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.dd7fbd1a.js";import"./BookOutlined.31cb7ffb.js";import"./url.a282f1d5.js";import"./Paragraph.51f31516.js";import"./Base.7b44942c.js";import"./Modal.17cdde78.js";import"./index.18754ce2.js";import"./Title.6affb5db.js";import"./Text.a2f30647.js";import"./index.f0d39170.js";import"./index.313eccac.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]="30ea4e4f-ff72-4d31-b760-03d2808024b2",t._sentryDebugIdIdentifier="sentry-dbid-30ea4e4f-ff72-4d31-b760-03d2808024b2")}catch{}})();const W=y({__name:"Editors",setup(t){const a=b().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=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:()=>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.6eceacde.js.map
