import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.2096912b.js";import{a as I}from"./asyncComputed.7ba20277.js";import{b as k}from"./router.ec793a32.js";import"./index.1e0d0d09.js";import{M as n}from"./member.cb09bf7c.js";import{C as x}from"./CrudView.c9fd091e.js";import{F as C}from"./icons.e6f1393c.js";import{a as M}from"./ant-design.dee70422.js";import"./FormItem.52d606d6.js";import"./hasIn.3063693a.js";import"./index.cf4c23b9.js";import"./record.a78568e3.js";import"./pubsub.29d64bef.js";import"./Paragraph.144ab0b0.js";import"./Base.33ff443a.js";import"./Form.effee9fb.js";import"./Modal.1ff3292e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.69c0b93f.js";import"./url.9f77d2c5.js";import"./index.b16b39d7.js";import"./Title.5e6ffead.js";import"./Text.2528d1f7.js";import"./index.39b4efaf.js";import"./index.5e44a5ad.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]="6524e194-f2e5-4562-b8cc-c821a515498d",t._sentryDebugIdIdentifier="sentry-dbid-6524e194-f2e5-4562-b8cc-c821a515498d")}catch{}})();const X=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 p(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,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:()=>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:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.ef54b223.js.map
