import{d as y,eE as b,J as g,b as _,c as w,u as h,eS as I}from"./outputWidgets.e32c4de9.js";import{a as k}from"./asyncComputed.cd8e83d5.js";import{b as x}from"./router.d15ff954.js";import"./index.3e2bee12.js";import{M as n}from"./member.449ff079.js";import{C}from"./CrudView.7262a743.js";import{a as v}from"./ant-design.72396149.js";import"./Form.6e618181.js";import"./hasIn.e17bd528.js";import"./popupNotifcation.63897623.js";import"./record.f085fb76.js";import"./pubsub.574e50fa.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.bcdaf646.js";import"./BookOutlined.c9465756.js";import"./url.b82290c2.js";import"./Paragraph.27861c63.js";import"./Base.583225bc.js";import"./Modal.3e62e331.js";import"./index.66b88b11.js";import"./Title.e20804f9.js";import"./Text.81365b40.js";import"./index.5d1f98c6.js";import"./index.68cc9488.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]="6f749c1a-507d-412e-96c1-6b3abac58fa7",t._sentryDebugIdIdentifier="sentry-dbid-6f749c1a-507d-412e-96c1-6b3abac58fa7")}catch{}})();const W=y({__name:"Editors",setup(t){const a=b().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.a2da1653.js.map
