import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.16ea2802.js";import{a as I}from"./asyncComputed.47e4eb5e.js";import{b as k}from"./router.84d64d32.js";import"./index.d6d761a8.js";import{M as n}from"./member.59aecfcd.js";import{C as x}from"./CrudView.b97202ef.js";import{K as C}from"./icons.ab8b614a.js";import{a as M}from"./ant-design.cef67a1f.js";import"./Form.8992253c.js";import"./hasIn.4309230e.js";import"./index.cf4c23b9.js";import"./record.a44a4b35.js";import"./pubsub.af6aba89.js";import"./Paragraph.069ce9fd.js";import"./Base.5893a998.js";import"./Typography.1157fa19.js";import"./Modal.cc91ab2e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d36a2165.js";import"./url.4e0b2dd1.js";import"./index.124f0a07.js";import"./Title.3acc75f2.js";import"./Text.f1c3ccc8.js";import"./index.abf95935.js";import"./index.1d0a03a3.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]="c2f57759-ab64-4c81-a1da-8f634fa3aa7d",t._sentryDebugIdIdentifier="sentry-dbid-c2f57759-ab64-4c81-a1da-8f634fa3aa7d")}catch{}})();const X=b({__name:"Members",setup(t){const o=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(o,e.email),m()};async function d(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(o,e.authorId),m())}const{loading:p,result:u,refetch:m}=I(()=>n.list(o)),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(a=>{var s;return{key:a.email,cells:[{type:"text",text:a.email},{type:"text",text:a.role},{type:"actions",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===a.email?[]:[{icon:C,label:"Remove access",onClick:()=>d(a),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.23bfe380.js.map
