import{d as y,eD as g,I as b,b as _,c as w,u as I,eR as h}from"./outputWidgets.0112c29a.js";import{a as k}from"./asyncComputed.7a4cd8c0.js";import{b as x}from"./router.baccdf57.js";import"./index.01d20c53.js";import{M as n}from"./member.6f48e0d6.js";import{C}from"./CrudView.24263641.js";import{a as v}from"./ant-design.09addbee.js";import"./Form.f084c7e0.js";import"./hasIn.9ed92b42.js";import"./popupNotifcation.b5f4e167.js";import"./record.63beb4c2.js";import"./pubsub.bc9264fd.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e7adff9f.js";import"./BookOutlined.cb11abba.js";import"./url.3a6cd3b5.js";import"./Paragraph.a79b7e0d.js";import"./Text.7fd7d6e4.js";import"./Modal.4672b2be.js";import"./index.0b86c71c.js";import"./Title.06b9fc65.js";import"./index.84aac883.js";import"./index.7eba7835.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]="301f8fe8-e888-4a09-aa23-3f313609f7f7",t._sentryDebugIdIdentifier="sentry-dbid-301f8fe8-e888-4a09-aa23-3f313609f7f7")}catch{}})();const U=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:f,refetch:s}=k(()=>n.list(a)),u=b(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=f.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:h,label:"Remove access",onClick:()=>c(o),dangerous:!0}]}]}}))!=null?i:[]}});return(e,i)=>(_(),w(C,{"entity-name":"editors",loading:I(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:u.value,"create-button-text":"Add editors",fields:l,onCreate:d},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Editors.dc9684d4.js.map
