import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.0277cbbd.js";import{a as I}from"./asyncComputed.d55fcd20.js";import{b as k}from"./router.80da957b.js";import"./index.484a88f2.js";import{M as n}from"./member.bfb5d34a.js";import{C as x}from"./CrudView.783d1b27.js";import{F as C}from"./icons.4110f4c3.js";import{a as M}from"./ant-design.32d39fd0.js";import"./FormItem.6e3fad7e.js";import"./hasIn.30cc1d4f.js";import"./index.cf4c23b9.js";import"./record.cc1b684f.js";import"./pubsub.9dc2e6ac.js";import"./Paragraph.11321d3e.js";import"./Base.b6a7a457.js";import"./Form.c7b890a6.js";import"./Modal.3b9fd86c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.13181c55.js";import"./url.044e3d41.js";import"./index.89cecc01.js";import"./Title.e05b5b52.js";import"./Text.c62153b6.js";import"./index.23b4fff1.js";import"./index.f4aebc3d.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]="b7e6aac9-675a-4ef5-8f9c-361526ae2039",t._sentryDebugIdIdentifier="sentry-dbid-b7e6aac9-675a-4ef5-8f9c-361526ae2039")}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.16016601.js.map
