import{d as b,eB as y,H as g,b as _,c as w,u as h,eP as I}from"./outputWidgets.225dd371.js";import{a as k}from"./asyncComputed.8a54909a.js";import{b as x}from"./router.8e23138d.js";import"./index.2924e62a.js";import{M as n}from"./member.7868c9ce.js";import{C}from"./CrudView.72bd6d5e.js";import{a as v}from"./ant-design.a00feaec.js";import"./Form.12e2d16e.js";import"./hasIn.1e38e049.js";import"./popupNotifcation.6873325b.js";import"./index.cf4c23b9.js";import"./record.b805ac15.js";import"./pubsub.3bce7ea8.js";import"./Paragraph.253f2b2e.js";import"./Text.a0f2d781.js";import"./Modal.0a797886.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.c28d2d29.js";import"./url.29c1f37b.js";import"./index.8e2737d3.js";import"./Title.bbb77099.js";import"./index.42c8bfb7.js";import"./index.86c302fc.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]="b2c5d461-a490-46ec-ab6a-791d2cd79b01",t._sentryDebugIdIdentifier="sentry-dbid-b2c5d461-a490-46ec-ab6a-791d2cd79b01")}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: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{U as default};
//# sourceMappingURL=Editors.d0867a31.js.map
