import{d as y,f1 as b,y as g,b as _,c as w,u as h,fd as I}from"./outputWidgets.ebb9dc3f.js";import{a as k}from"./asyncComputed.0cb7aad7.js";import{a as x}from"./gateway.a7a8b760.js";import"./index.3b769ef9.js";import{M as n}from"./member.21f93ab2.js";import{C}from"./CrudView.f47dcfb5.js";import{a as v}from"./ant-design.9f7ccebc.js";import"./popupNotifcation.3052c41b.js";import"./record.130efaea.js";import"./pubsub.5478cedc.js";import"./router.df8ee085.js";import"./Form.5a466b31.js";import"./hasIn.3d4a7cb6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.0cb28c5e.js";import"./BookOutlined.7d13399d.js";import"./url.f808e39f.js";import"./Modal.6c0f75b4.js";import"./index.514ae14d.js";import"./index.f9970f77.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]="b2f7e56b-7458-4725-a6d4-92a94326c434",t._sentryDebugIdIdentifier="sentry-dbid-b2f7e56b-7458-4725-a6d4-92a94326c434")}catch{}})();const Q=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{Q as default};
//# sourceMappingURL=Editors.5e382017.js.map
