import{d as y,f1 as g,y as b,b as _,c as w,u as h,fd as I}from"./outputWidgets.025875ae.js";import{a as k}from"./asyncComputed.462004f9.js";import{a as x}from"./gateway.22351b60.js";import"./index.48af091d.js";import{M as n}from"./member.c920fab5.js";import{C}from"./CrudView.b45d6510.js";import{a as v}from"./ant-design.15b10cbf.js";import"./popupNotifcation.276e8491.js";import"./record.99a7b773.js";import"./pubsub.6d633724.js";import"./string.1546f2c1.js";import"./router.a193549d.js";import"./Form.4bccb38e.js";import"./hasIn.5eeb7ad9.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.2461c107.js";import"./BookOutlined.293af00d.js";import"./url.53dfb2e6.js";import"./Modal.0d97ee5b.js";import"./index.55b94c0b.js";import"./index.b314ee54.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]="6ac42d82-af2f-499c-993f-62e44f0b7206",t._sentryDebugIdIdentifier="sentry-dbid-6ac42d82-af2f-499c-993f-62e44f0b7206")}catch{}})();const S=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:f,result:p,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=p.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(f),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{S as default};
//# sourceMappingURL=Editors.26964296.js.map
