import{d as y,eA as g,H as b,b as _,c as w,u as h,eP as I}from"./outputWidgets.8f35e76b.js";import{a as k}from"./asyncComputed.b2c7682e.js";import{b as x}from"./router.eb6cf81e.js";import"./index.fb4a4209.js";import{M as n}from"./member.03521b52.js";import{C}from"./CrudView.4b14d77c.js";import{a as v}from"./ant-design.5e6d66d7.js";import"./Form.357810f8.js";import"./hasIn.38270313.js";import"./popupNotifcation.20f659d9.js";import"./index.cf4c23b9.js";import"./record.56272af3.js";import"./pubsub.aac2ae7d.js";import"./Paragraph.5b35e944.js";import"./Text.cb1b4ad4.js";import"./Modal.3cec70ce.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7378a41f.js";import"./BookOutlined.b79ac83a.js";import"./url.99f1e379.js";import"./index.30032ec4.js";import"./Title.984d5105.js";import"./index.1d88a799.js";import"./index.01563854.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]="64835922-7807-4304-96e1-5188a6df9742",t._sentryDebugIdIdentifier="sentry-dbid-64835922-7807-4304-96e1-5188a6df9742")}catch{}})();const W=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:p,result:u,refetch:s}=k(()=>n.list(a)),f=b(()=>{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:l,onCreate:d},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.17fdd961.js.map
