import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.73e48adb.js";import{a as I}from"./asyncComputed.02c9e941.js";import{b as k}from"./router.32167d1f.js";import"./index.9dbecee6.js";import{M as n}from"./member.4ed6090f.js";import{C as x}from"./CrudView.835ae129.js";import{K as C}from"./icons.37a32d23.js";import{a as M}from"./ant-design.643041cf.js";import"./Form.96a128f7.js";import"./hasIn.e1935081.js";import"./index.cf4c23b9.js";import"./record.dad9df30.js";import"./pubsub.5ce27a1f.js";import"./Paragraph.2c7f637b.js";import"./Base.dc6b2177.js";import"./Typography.343bcd00.js";import"./Modal.cc696ff2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d98a9d0d.js";import"./url.ee9a902a.js";import"./index.27d555b2.js";import"./Title.42a97159.js";import"./Text.6ed098e9.js";import"./index.198d7afa.js";import"./index.7995cda6.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]="84a92def-d8a8-4313-af24-8ba5651ac96e",t._sentryDebugIdIdentifier="sentry-dbid-84a92def-d8a8-4313-af24-8ba5651ac96e")}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 d(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:"",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:()=>d(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:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.7305abb2.js.map
