import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.37f6afb9.js";import{a as I}from"./asyncComputed.1b0ebb2f.js";import{b as k}from"./router.1752b917.js";import"./index.f642c88e.js";import{M as n}from"./member.5d1d91d3.js";import{C as x}from"./CrudView.6ec806ba.js";import{K as C}from"./icons.49183eff.js";import{a as M}from"./ant-design.8d11ff0f.js";import"./Form.e63f4928.js";import"./hasIn.1fb16ad3.js";import"./index.cf4c23b9.js";import"./record.adcae6a4.js";import"./pubsub.6ac68cf0.js";import"./Paragraph.c5c6929c.js";import"./Base.067483d1.js";import"./Typography.1a6183ac.js";import"./Modal.d5b5554a.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.48ce5d8b.js";import"./url.47579a16.js";import"./index.8206ccd9.js";import"./Title.c307da82.js";import"./Text.9798d4a1.js";import"./index.7808130f.js";import"./index.713cffb3.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]="da255561-c1a1-4d63-990d-fd7ff81dfbb8",t._sentryDebugIdIdentifier="sentry-dbid-da255561-c1a1-4d63-990d-fd7ff81dfbb8")}catch{}})();const X=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 c(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,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:()=>c(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(p),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:u.value,"create-button-text":"Add members",fields:l,onCreate:d},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.c93e29f3.js.map
