import{d as f,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.fe662b4f.js";import{a as I}from"./asyncComputed.60882aa5.js";import{b as k}from"./router.359674ae.js";import"./index.dc77b07b.js";import{M as n}from"./member.ebb02a07.js";import{C as x}from"./CrudView.51a3daa0.js";import{K as C}from"./icons.06e79e54.js";import{a as M}from"./ant-design.f876da58.js";import"./Form.240adf1b.js";import"./hasIn.36cbd9d8.js";import"./index.cf4c23b9.js";import"./record.b07c9a4f.js";import"./pubsub.d5a444ac.js";import"./Paragraph.4acd5c9c.js";import"./Base.752e5f84.js";import"./Typography.a9c97257.js";import"./Modal.c3452f91.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.069b2a70.js";import"./url.e299df37.js";import"./index.96fe91d4.js";import"./Title.694e574f.js";import"./Text.79714a42.js";import"./index.6c541f9d.js";import"./index.fb6346ff.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]="5b00c3b2-2d4a-4745-b3c9-1bc015e99928",t._sentryDebugIdIdentifier="sentry-dbid-5b00c3b2-2d4a-4745-b3c9-1bc015e99928")}catch{}})();const X=f({__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)),b=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:b.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.670ccbee.js.map
