import{d as b,ez as y,F as g,b as _,c as w,u as h}from"./outputWidgets.34c6efe4.js";import{a as I}from"./asyncComputed.c2993a02.js";import{b as k}from"./router.5e015991.js";import"./index.56db27ff.js";import{M as n}from"./member.08d3904e.js";import{C as x}from"./CrudView.4c8279a4.js";import{F as C}from"./icons.54b54949.js";import{a as M}from"./ant-design.ecbe403a.js";import"./FormItem.87557e8f.js";import"./hasIn.7f8c0878.js";import"./jwt-decode.esm.74bd4619.js";import"./storage.f2a353cd.js";import"./index.b5389b8f.js";import"./index.cf4c23b9.js";import"./record.24a52f99.js";import"./pubsub.7392fe5a.js";import"./Title.6b365a17.js";import"./Text.4d22598c.js";import"./Form.3d80c841.js";import"./Modal.20b7a2a4.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d3e3a57a.js";import"./url.e9fe64cc.js";import"./index.95a2f4e1.js";import"./index.1f3ae6b3.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]="2d490f9c-11fa-4346-b863-44d8236dd10e",t._sentryDebugIdIdentifier="sentry-dbid-2d490f9c-11fa-4346-b863-44d8236dd10e")}catch{}})();const X=b({__name:"Members",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(a,e.email),m()};async function c(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: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:()=>c(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:f.value,"create-button-text":"Add members",fields:l,onCreate:d},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.fbe9dae6.js.map
