import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.74b0761d.js";import{a as I}from"./asyncComputed.fbb4ba44.js";import{b as k}from"./router.e97d6286.js";import"./index.c51517e3.js";import{M as n}from"./member.5bc6fef4.js";import{C as x}from"./CrudView.742df36b.js";import{K as C}from"./icons.fd5c09b0.js";import{a as v}from"./ant-design.0fbbfb6c.js";import"./Form.a24c61ad.js";import"./hasIn.d2130316.js";import"./popupNotifcation.2bb5bdcc.js";import"./index.cf4c23b9.js";import"./record.acc69298.js";import"./pubsub.4c1d9617.js";import"./Paragraph.5d2768c0.js";import"./Base.4463d78c.js";import"./Typography.5e0282a3.js";import"./Modal.80395829.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9e6cb829.js";import"./url.0584bb06.js";import"./index.0327679a.js";import"./Title.a6d4b5b0.js";import"./Text.b007494b.js";import"./index.2189f45b.js";import"./index.87f32a2c.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="fe7fbf26-ffae-41b1-8323-36cbaad0e15a",t._sentryDebugIdIdentifier="sentry-dbid-fe7fbf26-ffae-41b1-8323-36cbaad0e15a")}catch{}})();const Y=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(a,e.email),m()};async function p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,result:f,refetch:m}=I(()=>n.list(a)),u=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=f.value)==null?void 0:e.map(o=>{var s;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===o.email?[]:[{icon:C,label:"Remove access",onClick:()=>p(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(d),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.a1aeacf4.js.map
