import{d as b,eE as y,J as g,b as _,c as w,u as h,eS as I}from"./outputWidgets.7dd23d3d.js";import{a as k}from"./asyncComputed.8f047c40.js";import{b as x}from"./router.55ae8196.js";import"./index.c33cd5e4.js";import{M as n}from"./member.cf76d687.js";import{C}from"./CrudView.5a4776e3.js";import{a as v}from"./ant-design.410c5d74.js";import"./Form.9f41d3b4.js";import"./hasIn.7d5dcda7.js";import"./popupNotifcation.f54fc99f.js";import"./record.4544f931.js";import"./pubsub.692bcdfa.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e5b6cc98.js";import"./BookOutlined.ecab59cc.js";import"./url.6301f7e9.js";import"./Paragraph.7df229fc.js";import"./Base.4bf9624b.js";import"./Modal.5fb5fcda.js";import"./index.8d63ab0d.js";import"./Title.0952eb37.js";import"./Text.8f0caa1d.js";import"./index.a5cb16ca.js";import"./index.667384b8.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]="d46ceca4-3b4f-4db4-bd57-029480d6d3ff",t._sentryDebugIdIdentifier="sentry-dbid-d46ceca4-3b4f-4db4-bd57-029480d6d3ff")}catch{}})();const W=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: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:d,onCreate:l},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.1d4590f3.js.map
