import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.6830fc2d.js";import{a as I}from"./asyncComputed.46a733c1.js";import{b as k}from"./router.c745a3c2.js";import"./index.fddb9e1e.js";import{M as n}from"./member.290a8fee.js";import{C as x}from"./CrudView.432fe0c4.js";import{D as C}from"./icons.31e4fa46.js";import{a as M}from"./ant-design.f8e1bed1.js";import"./FormItem.278e4518.js";import"./hasIn.48daad41.js";import"./index.cf4c23b9.js";import"./record.416df660.js";import"./pubsub.6d4f7540.js";import"./Paragraph.c22304c7.js";import"./Base.e8ab0cc0.js";import"./Form.a8618886.js";import"./Modal.e109cdd2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.6b319732.js";import"./url.1f48e231.js";import"./index.a26dbe33.js";import"./Title.10b04a9c.js";import"./Text.b2a17f23.js";import"./index.ec7fc193.js";import"./index.e51935e8.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]="ef57cabc-2f89-4d0e-962e-fcc8b191fe93",t._sentryDebugIdIdentifier="sentry-dbid-ef57cabc-2f89-4d0e-962e-fcc8b191fe93")}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:f,refetch:m}=I(()=>n.list(a)),u=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=f.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:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.f5d2d66b.js.map
