import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.3b5544a6.js";import{a as I}from"./asyncComputed.31721c4c.js";import{b as k}from"./router.3a7d33dd.js";import"./index.3fed70db.js";import{M as n}from"./member.716f64a5.js";import{C as x}from"./CrudView.5b4c76d9.js";import{K as C}from"./icons.df70cc36.js";import{a as M}from"./ant-design.4a664065.js";import"./Form.3820cb93.js";import"./hasIn.98da9760.js";import"./index.cf4c23b9.js";import"./record.87959be0.js";import"./pubsub.3378c421.js";import"./Paragraph.52c6b305.js";import"./Base.ed5c11ff.js";import"./Typography.c58b2a2b.js";import"./Modal.91605301.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.2b9e572d.js";import"./url.ddec584d.js";import"./index.25ca8db5.js";import"./Title.0af7b814.js";import"./Text.4f034af0.js";import"./index.6e4724f1.js";import"./index.7739e2da.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]="c7f217a7-e47a-4476-8d8f-56b2f54edf1a",t._sentryDebugIdIdentifier="sentry-dbid-c7f217a7-e47a-4476-8d8f-56b2f54edf1a")}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: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:()=>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:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.d7374645.js.map
