import{d as y,f1 as b,y as g,b as _,c as w,u as h,fd as I}from"./outputWidgets.ac6cd083.js";import{a as k}from"./asyncComputed.9193ddba.js";import{a as x}from"./gateway.7df23bb5.js";import"./index.b64d2bf2.js";import{M as n}from"./member.26b3992d.js";import{C}from"./CrudView.d6db1351.js";import{a as v}from"./ant-design.c1a1db54.js";import"./popupNotifcation.bfef6e4c.js";import"./record.9a0f3e6a.js";import"./pubsub.ead516dd.js";import"./string.0e36ef9a.js";import"./router.e7c73114.js";import"./Form.f2d1ae9b.js";import"./hasIn.aae3ac3f.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.1b2ad75a.js";import"./BookOutlined.ea51c13c.js";import"./url.d933d93f.js";import"./Modal.1a3291a2.js";import"./index.24c3a2c4.js";import"./index.113c67d9.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]="dbc2a29e-5afa-4a1e-b85f-d2fd86d7b898",t._sentryDebugIdIdentifier="sentry-dbid-dbc2a29e-5afa-4a1e-b85f-d2fd86d7b898")}catch{}})();const S=y({__name:"Editors",setup(t){const a=b().params.organizationId,m=[{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:f,refetch:s}=k(()=>n.list(a)),u=g(()=>{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 d;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((d=x.getAuthor())==null?void 0:d.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:u.value,"create-button-text":"Add editors",fields:m,onCreate:l},null,8,["loading","table"]))}});export{S as default};
//# sourceMappingURL=Editors.316b13ea.js.map
