import{d as b,eB as y,G as g,b as _,c as w,u as C}from"./outputWidgets.c7d3adb6.js";import{a as I}from"./asyncComputed.503b98af.js";import{a as h}from"./authorManager.e16729e9.js";import"./index.25051644.js";import{M as n}from"./member.2bf7da74.js";import{C as k}from"./CrudView.a5c5f789.js";import{C as v}from"./icons.04bb36b4.js";import{a as M}from"./ant-design.a9239b18.js";import"./index.cf4c23b9.js";import"./record.75c383f2.js";import"./pubsub.83cf89e6.js";import"./gateway.bdb6eee5.js";import"./Title.07360565.js";import"./Text.b8f940d0.js";import"./FormItem.424fcca7.js";import"./hasIn.2d7f1a4b.js";import"./Form.d2f4c6bd.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a0e6335c.js";import"./router.7306eaee.js";import"./index.935dd85c.js";import"./url.125f4924.js";import"./index.7fe1152d.js";import"./index.402d7e13.js";import"./index.4508a88d.js";import"./index.8b862542.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]="e94fb6c2-c1a0-4a34-afa0-6d445ff1f96a",t._sentryDebugIdIdentifier="sentry-dbid-e94fb6c2-c1a0-4a34-afa0-6d445ff1f96a")}catch{}})();const Y=b({__name:"Members",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 M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,result:f,refetch:m}=I(()=>n.list(a)),u=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"Actions"}],rows:(r=(e=f.value)==null?void 0:e.map(o=>{var s;return{key:o.email,cells:[{text:o.email},{text:o.role},{text:"",actions:((s=h.getAuthor())==null?void 0:s.claims.email)===o.email?void 0:[{icon:v,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(k,{"entity-name":"members",loading:C(p),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=Members.e17fe045.js.map
