import{d as b,eG as y,D as g,b as _,c as w,u as h,eS as I}from"./outputWidgets.e5f9ffc6.js";import{a as k}from"./asyncComputed.2210bd1a.js";import{b as x}from"./router.dd631582.js";import"./index.889e1616.js";import{M as n}from"./member.6ddaedd3.js";import{C}from"./CrudView.542c4e4e.js";import{a as v}from"./ant-design.03b4c57f.js";import"./Form.b45c0335.js";import"./hasIn.54609e4a.js";import"./popupNotifcation.9671db62.js";import"./record.3c5b5204.js";import"./pubsub.75396d00.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.670b5628.js";import"./BookOutlined.7d01e6a5.js";import"./url.c11ddd9f.js";import"./Paragraph.1cbc8077.js";import"./Base.d0d329e2.js";import"./Modal.e18542c5.js";import"./index.2570caf9.js";import"./Title.f988141d.js";import"./Text.e6c27a3b.js";import"./index.f056a823.js";import"./index.6b873e6f.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8f3a6b96-a93b-4b68-b94c-39478c5c9245",e._sentryDebugIdIdentifier="sentry-dbid-8f3a6b96-a93b-4b68-b94c-39478c5c9245")}catch{}})();const W=b({__name:"Editors",setup(e){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async t=>{await n.create(a,t.email),s()};async function d(t){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,t.authorId),s())}const{loading:p,result:u,refetch:s}=k(()=>n.list(a)),f=g(()=>{var t,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(t=u.value)==null?void 0:t.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:()=>d(o),dangerous:!0}]}]}}))!=null?i:[]}});return(t,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:c},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.92c2457a.js.map
