import{d as b,eB as y,G as g,b as _,c as w,u as C}from"./outputWidgets.fdae7e91.js";import{a as I}from"./asyncComputed.43537aae.js";import{a as h}from"./authorManager.adc33c37.js";import"./index.30fe2a77.js";import{M as n}from"./member.5db855db.js";import{C as k}from"./CrudView.e3fe23cf.js";import{C as v}from"./icons.59384d21.js";import{a as M}from"./ant-design.f2f7cc3b.js";import"./index.cf4c23b9.js";import"./record.f963a373.js";import"./pubsub.61789656.js";import"./gateway.8c35b4b8.js";import"./Title.e4079793.js";import"./Text.2d7466b9.js";import"./FormItem.45b6065e.js";import"./hasIn.e6601643.js";import"./Form.d4070d32.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.ed9adb70.js";import"./router.ae435e74.js";import"./index.6f560850.js";import"./url.f60fbe92.js";import"./index.42add8ec.js";import"./index.9026b0b4.js";import"./index.a700463c.js";import"./index.dedb9dc3.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]="b7f21a53-43d8-4234-86a6-ae15ab00d773",t._sentryDebugIdIdentifier="sentry-dbid-b7f21a53-43d8-4234-86a6-ae15ab00d773")}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 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:u,refetch:m}=I(()=>n.list(a)),f=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"Actions"}],rows:(r=(e=u.value)==null?void 0:e.map(o=>{var s;return{key:o.email,cells:[{text:o.email},{text:o.role},{text:"",actions:((s=h.getAuthor())==null?void 0:s.claims.email)===o.email?void 0:[{icon:v,label:"Remove access",onClick:()=>c(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(k,{"entity-name":"members",loading:C(p),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.accc920c.js.map
