import{d as y,f1 as b,y as g,b as _,c as w,u as h,fd as I}from"./outputWidgets.bff33647.js";import{a as k}from"./asyncComputed.ce6d6eed.js";import{a as x}from"./gateway.fd75c1ba.js";import"./index.b40d3bd7.js";import{M as n}from"./member.05645a72.js";import{C}from"./CrudView.8a89e4ec.js";import{a as v}from"./ant-design.a26c9ca9.js";import"./popupNotifcation.29ddd2ec.js";import"./record.29a71a1c.js";import"./pubsub.897f848f.js";import"./router.8006b2c4.js";import"./Form.70e7f6b0.js";import"./hasIn.edcda2a9.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.2be6635f.js";import"./BookOutlined.62d0439b.js";import"./url.9e111d9b.js";import"./Modal.b7012161.js";import"./index.652b8bc4.js";import"./index.478da89c.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]="bddb90d4-6380-4da4-a318-f8ba382e706a",t._sentryDebugIdIdentifier="sentry-dbid-bddb90d4-6380-4da4-a318-f8ba382e706a")}catch{}})();const Q=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: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 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:f.value,"create-button-text":"Add editors",fields:m,onCreate:l},null,8,["loading","table"]))}});export{Q as default};
//# sourceMappingURL=Editors.4da368e4.js.map
