import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.6eec98ff.js";import{a as I}from"./asyncComputed.1526d434.js";import{b as k}from"./router.9c6f57ba.js";import"./index.cdb0f83d.js";import{M as n}from"./member.2ac3ac62.js";import{C as x}from"./CrudView.ab56bc26.js";import{K as C}from"./icons.6b845aee.js";import{a as M}from"./ant-design.ee279ac7.js";import"./Form.2af9c413.js";import"./hasIn.58de5617.js";import"./index.cf4c23b9.js";import"./record.3e6d2f52.js";import"./pubsub.e1022b3e.js";import"./Paragraph.c531076e.js";import"./Base.f2e41c2f.js";import"./Typography.ec01cc4a.js";import"./Modal.bba2f35f.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e4be45ac.js";import"./url.9665974d.js";import"./index.ab3fd656.js";import"./Title.99e8adef.js";import"./Text.fdd11fc0.js";import"./index.c7f8a481.js";import"./index.a120741e.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]="976b89da-1103-459a-89aa-0e3ac277041e",t._sentryDebugIdIdentifier="sentry-dbid-976b89da-1103-459a-89aa-0e3ac277041e")}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: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:()=>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:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.a16fd459.js.map
