import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.d0655b77.js";import{a as I}from"./asyncComputed.6d9729a3.js";import{b as k}from"./router.f0341f86.js";import"./index.ec8c2171.js";import{M as n}from"./member.e33d1672.js";import{C as x}from"./CrudView.c731a69e.js";import{K as C}from"./icons.48cd3bcb.js";import{a as v}from"./ant-design.997654c9.js";import"./Form.7eb0b389.js";import"./hasIn.195539bf.js";import"./index.cf4c23b9.js";import"./record.f8788007.js";import"./pubsub.8725881c.js";import"./Paragraph.e2948537.js";import"./Base.f7249e73.js";import"./Typography.a3b07fc7.js";import"./Modal.6e2e9de7.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d8c95f41.js";import"./url.33464e0a.js";import"./index.f6421c28.js";import"./Title.9cf52895.js";import"./Text.9f828711.js";import"./index.0c97541b.js";import"./index.8c38d951.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]="f5a8788e-b616-45c5-adb0-c2bc0432be26",t._sentryDebugIdIdentifier="sentry-dbid-f5a8788e-b616-45c5-adb0-c2bc0432be26")}catch{}})();const X=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 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}=I(()=>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=k.getAuthor())==null?void 0:s.claims.email)===o.email?[]:[{icon:C,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"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:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.26de886e.js.map
