import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.244ba1c8.js";import{a as I}from"./asyncComputed.9805a381.js";import{b as k}from"./router.60675eeb.js";import"./index.bec3aec1.js";import{M as n}from"./member.84bf93e3.js";import{C as x}from"./CrudView.47ed1f4a.js";import{D as C}from"./icons.a522dd78.js";import{a as M}from"./ant-design.2b0214de.js";import"./FormItem.e7fba2a7.js";import"./hasIn.d73516ff.js";import"./index.cf4c23b9.js";import"./record.5766e9f8.js";import"./pubsub.f74b1921.js";import"./Paragraph.bffb9dac.js";import"./Base.2351f159.js";import"./Typography.52981f51.js";import"./Form.f49cd330.js";import"./Modal.ff9cdc66.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.aee5d1fe.js";import"./url.f5db59c1.js";import"./index.08ab98c1.js";import"./Title.eb85429e.js";import"./Text.fbfa9a45.js";import"./index.feab3270.js";import"./index.d38d9f1b.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]="b8aa5dbf-a650-4191-a1bd-61471f6f5528",t._sentryDebugIdIdentifier="sentry-dbid-b8aa5dbf-a650-4191-a1bd-61471f6f5528")}catch{}})();const Y=b({__name:"Members",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],d=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:c,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(c),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:f.value,"create-button-text":"Add members",fields:l,onCreate:d},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Members.a6e869f3.js.map
