import{d as y,eG as b,y as g,b as _,c as w,u as h,eS as I}from"./outputWidgets.52571dac.js";import{a as k}from"./asyncComputed.2a2a1288.js";import{a as x}from"./gateway.9b472f57.js";import"./index.803d0576.js";import{M as n}from"./member.8daf34d1.js";import{C}from"./CrudView.6cb8ad38.js";import{a as v}from"./ant-design.903f71e5.js";import"./popupNotifcation.e85fac74.js";import"./record.2a93f29c.js";import"./pubsub.be7004e9.js";import"./router.0ae1ef4a.js";import"./Form.9e43a28b.js";import"./hasIn.f1c353ba.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a5567333.js";import"./BookOutlined.7e4ac738.js";import"./url.5cc70021.js";import"./Paragraph.7aa2ce32.js";import"./Base.e64db743.js";import"./Modal.514213ca.js";import"./index.89edc4ba.js";import"./Title.8fbc2e7d.js";import"./Text.0586c869.js";import"./index.f3e1df2a.js";import"./index.109082a3.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]="7e29552b-f665-4959-b18c-97feac499c41",t._sentryDebugIdIdentifier="sentry-dbid-7e29552b-f665-4959-b18c-97feac499c41")}catch{}})();const X=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{X as default};
//# sourceMappingURL=Editors.e14b8682.js.map
