import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.bb2f46e4.js";import{a as I}from"./asyncComputed.8bd59622.js";import{b as k}from"./router.00bad958.js";import"./index.1bde37fc.js";import{M as n}from"./member.702c21f8.js";import{C as x}from"./CrudView.14583dec.js";import{F as C}from"./icons.94ad51fe.js";import{a as M}from"./ant-design.9ba9b232.js";import"./FormItem.744edb5b.js";import"./hasIn.9a8a8af5.js";import"./index.cf4c23b9.js";import"./record.dd66f38b.js";import"./pubsub.9e4f8bfd.js";import"./Paragraph.c54bf5b6.js";import"./Base.3e5c9785.js";import"./Form.fe337595.js";import"./Modal.6f9d473d.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.aaad4840.js";import"./url.1b83203f.js";import"./index.77677488.js";import"./Title.85b45f4d.js";import"./Text.3cea9169.js";import"./index.38894597.js";import"./index.e2651b4f.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]="d8f25549-0219-4168-9709-781793eba680",t._sentryDebugIdIdentifier="sentry-dbid-d8f25549-0219-4168-9709-781793eba680")}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.da23d6ee.js.map
