import{d as b,eE as y,J as g,b as _,c as w,u as h,eS as I}from"./outputWidgets.aedb9989.js";import{a as k}from"./asyncComputed.710d44a6.js";import{b as x}from"./router.c6e9e955.js";import"./index.eaab4db2.js";import{M as n}from"./member.8d9fef40.js";import{C}from"./CrudView.aa5100f4.js";import{a as v}from"./ant-design.83d003b2.js";import"./Form.cfc41f21.js";import"./hasIn.468b611c.js";import"./popupNotifcation.f175fce5.js";import"./record.168f9da8.js";import"./pubsub.96a03d8f.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f112c775.js";import"./BookOutlined.2df3b27a.js";import"./url.c520dda4.js";import"./Paragraph.077143bd.js";import"./Base.1e4eebff.js";import"./Modal.6d96e682.js";import"./index.5834849d.js";import"./Title.a34b96de.js";import"./Text.b2be5925.js";import"./index.3574c638.js";import"./index.0c4ce959.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]="098d5c6b-1a51-40e1-ace7-5be580d5eb76",t._sentryDebugIdIdentifier="sentry-dbid-098d5c6b-1a51-40e1-ace7-5be580d5eb76")}catch{}})();const W=b({__name:"Editors",setup(t){const a=y().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.8010c00a.js.map
