import{d as y,f1 as b,y as g,b as _,c as w,u as h,fd as I}from"./outputWidgets.b408cd47.js";import{a as k}from"./asyncComputed.a7fc1aad.js";import{a as x}from"./gateway.5649747e.js";import"./index.a96bb8d2.js";import{M as n}from"./member.de041f71.js";import{C}from"./CrudView.b6646971.js";import{a as v}from"./ant-design.c2710ff5.js";import"./popupNotifcation.e99572f9.js";import"./record.7a308bd3.js";import"./pubsub.e8c4900b.js";import"./string.3b3d0b2e.js";import"./router.49371dd0.js";import"./Form.30ca3c8c.js";import"./hasIn.dda5a20c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.21e15a66.js";import"./BookOutlined.9049fb63.js";import"./url.266b2c44.js";import"./Modal.7c3fbdf2.js";import"./index.c368a61e.js";import"./index.37f20755.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]="dfe45ca3-4ddb-4112-977d-1aa46d9b7f88",t._sentryDebugIdIdentifier="sentry-dbid-dfe45ca3-4ddb-4112-977d-1aa46d9b7f88")}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: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{S as default};
//# sourceMappingURL=Editors.207399af.js.map
