import{d as y,eB as b,H as g,b as _,c as w,u as h,eP as I}from"./outputWidgets.e9677800.js";import{a as k}from"./asyncComputed.37b7af98.js";import{b as x}from"./router.e014ddc2.js";import"./index.21e91f9c.js";import{M as n}from"./member.9738366a.js";import{C}from"./CrudView.8e03181d.js";import{a as v}from"./ant-design.dbbf4726.js";import"./Form.9737d51d.js";import"./hasIn.bd3f78ff.js";import"./popupNotifcation.7148cdf9.js";import"./index.cf4c23b9.js";import"./record.767f28b7.js";import"./pubsub.9e36d89a.js";import"./Paragraph.394702f6.js";import"./Base.64d54b8f.js";import"./Typography.511f4fec.js";import"./Modal.df560cc7.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a4277c3a.js";import"./url.89c6b244.js";import"./index.42279d35.js";import"./Title.c954a24a.js";import"./Text.fd9e90fd.js";import"./index.1a0bd015.js";import"./index.bbda4abd.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]="f4590aee-c56c-4dfc-8ea3-ccd342cdf35a",t._sentryDebugIdIdentifier="sentry-dbid-f4590aee-c56c-4dfc-8ea3-ccd342cdf35a")}catch{}})();const X=y({__name:"Editors",setup(t){const a=b().params.organizationId,c=[{key:"email",label:"Email"}],l=async e=>{await n.create(a,e.email),m()};async function d(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,result:u,refetch:m}=k(()=>n.list(a)),f=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=u.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=x.getAuthor())==null?void 0:s.claims.email)===o.email?[]:[{icon:I,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(C,{"entity-name":"members",loading:h(p),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:f.value,"create-button-text":"Add members",fields:c,onCreate:l},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.891445cb.js.map
