import{d as y,eE as g,J as b,b as _,c as w,u as h,eS as I}from"./outputWidgets.6e1c5425.js";import{a as k}from"./asyncComputed.06ede41f.js";import{b as x}from"./router.4a0ba06b.js";import"./index.76daa7f6.js";import{M as n}from"./member.54aa99a1.js";import{C}from"./CrudView.88823d06.js";import{a as v}from"./ant-design.f246aa2b.js";import"./Form.b82a2cec.js";import"./hasIn.bf07751b.js";import"./popupNotifcation.76f4dd63.js";import"./record.c7d63161.js";import"./pubsub.4f3043c8.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.3a6e05dd.js";import"./BookOutlined.8202b78f.js";import"./url.5357e9db.js";import"./Paragraph.4ce326b3.js";import"./Base.0277cf44.js";import"./Modal.e50e9e9a.js";import"./index.c12e1c2f.js";import"./Title.dfd37452.js";import"./Text.b10c1140.js";import"./index.1442882a.js";import"./index.1a6a6e78.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]="a98634eb-9fed-4c34-9cc2-286823a057ac",t._sentryDebugIdIdentifier="sentry-dbid-a98634eb-9fed-4c34-9cc2-286823a057ac")}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.eb30344c.js.map
