import{d as b,eG as y,D as g,b as _,c as w,u as h,eS as I}from"./outputWidgets.7323a17d.js";import{a as k}from"./asyncComputed.a50f21d4.js";import{b as x}from"./router.7bb92c0e.js";import"./index.c9f11f2b.js";import{M as n}from"./member.493faa08.js";import{C}from"./CrudView.e2192329.js";import{a as v}from"./ant-design.aba87fd3.js";import"./Form.4d35a934.js";import"./hasIn.adc00278.js";import"./popupNotifcation.4e57751c.js";import"./record.1f033572.js";import"./pubsub.2c3883f4.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d07c372f.js";import"./BookOutlined.22bb6522.js";import"./url.50c4a8f0.js";import"./Paragraph.1e67eefb.js";import"./Base.003f7172.js";import"./Modal.8e6a9189.js";import"./index.42443749.js";import"./Title.88a7d0e4.js";import"./Text.a0b69008.js";import"./index.211f7220.js";import"./index.e70ae279.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]="64d60eb7-bd83-4a04-8fa2-ea549d96b4cd",t._sentryDebugIdIdentifier="sentry-dbid-64d60eb7-bd83-4a04-8fa2-ea549d96b4cd")}catch{}})();const W=b({__name:"Editors",setup(t){const a=y().params.organizationId,d=[{key:"email",label:"Email"}],l=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:d,onCreate:l},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.785c8a8a.js.map
