import{d as b,eD as y,I as g,b as _,c as w,u as I,eR as h}from"./outputWidgets.be3472c2.js";import{a as k}from"./asyncComputed.a619212b.js";import{b as x}from"./router.87bf43b6.js";import"./index.86288308.js";import{M as n}from"./member.4233f4e5.js";import{C}from"./CrudView.08af3b90.js";import{a as v}from"./ant-design.468f41c3.js";import"./Form.254a7379.js";import"./hasIn.bddd0a1a.js";import"./popupNotifcation.9025cc7b.js";import"./record.820df198.js";import"./pubsub.1063a0da.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f9aebc41.js";import"./BookOutlined.53049b66.js";import"./url.7fe1be7b.js";import"./Paragraph.7601abde.js";import"./Text.c9febe27.js";import"./Modal.304207b8.js";import"./index.ba676107.js";import"./Title.65752aa0.js";import"./index.6773e8c7.js";import"./index.f70acf7e.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]="d4d36ecb-330a-4eb7-ba67-2096da4fbf7e",t._sentryDebugIdIdentifier="sentry-dbid-d4d36ecb-330a-4eb7-ba67-2096da4fbf7e")}catch{}})();const U=b({__name:"Editors",setup(t){const a=y().params.organizationId,d=[{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 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:h,label:"Remove access",onClick:()=>c(o),dangerous:!0}]}]}}))!=null?i:[]}});return(e,i)=>(_(),w(C,{"entity-name":"editors",loading:I(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:f.value,"create-button-text":"Add editors",fields:d,onCreate:l},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Editors.10a2b2cd.js.map
