import{d as f,ez as y,F as g,b as _,c as w,u as h}from"./outputWidgets.c7dcc302.js";import{a as I}from"./asyncComputed.2f92c176.js";import{b as k}from"./router.cefd5d34.js";import"./index.29a1923e.js";import{M as n}from"./member.c4fa6cae.js";import{C as x}from"./CrudView.9fcd6ff5.js";import{F as C}from"./icons.b61c445b.js";import{a as M}from"./ant-design.362be163.js";import"./FormItem.e17f5a0a.js";import"./hasIn.84086a40.js";import"./jwt-decode.esm.74bd4619.js";import"./storage.ee8fed7f.js";import"./index.1dd4f14d.js";import"./index.cf4c23b9.js";import"./record.f3b213c9.js";import"./pubsub.d9e0718d.js";import"./Title.ec31295c.js";import"./Text.52e1267a.js";import"./Form.698fed96.js";import"./Modal.fa1b2cba.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.b32d63ba.js";import"./url.8333e91c.js";import"./index.7279efc8.js";import"./index.c8fd351b.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]="62b38b5d-cd2d-4f24-89db-e5376b4ddebd",t._sentryDebugIdIdentifier="sentry-dbid-62b38b5d-cd2d-4f24-89db-e5376b4ddebd")}catch{}})();const X=f({__name:"Members",setup(t){const r=y().params.organizationId,d=[{key:"email",label:"Email"}],l=async e=>{await n.create(r,e.email),m()};async function c(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:p,result:u,refetch:m}=I(()=>n.list(r)),b=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(a=(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:()=>c(o),dangerous:!0}]}]}}))!=null?a:[]}});return(e,a)=>(_(),w(x,{"entity-name":"members",loading:h(p),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:b.value,"create-button-text":"Add members",fields:d,onCreate:l},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.c39353be.js.map
