import{d as b,ez as y,F as g,b as _,c as w,u as h}from"./outputWidgets.b703ca45.js";import{a as I}from"./asyncComputed.557fdbc3.js";import{b as k}from"./router.c2e4e322.js";import"./index.58a6f7ec.js";import{M as n}from"./member.08888780.js";import{C as x}from"./CrudView.93e41830.js";import{F as C}from"./icons.5202cd65.js";import{a as M}from"./ant-design.db871477.js";import"./FormItem.39e0b98f.js";import"./hasIn.66135dec.js";import"./jwt-decode.esm.74bd4619.js";import"./storage.4f0beb94.js";import"./index.cd3799ce.js";import"./index.cf4c23b9.js";import"./record.6a34e5b4.js";import"./pubsub.781c61cb.js";import"./Title.c76d824d.js";import"./Text.4646803d.js";import"./Form.44bc3190.js";import"./Modal.c03e4b0a.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.69b7b47b.js";import"./url.7a748c18.js";import"./index.5255b475.js";import"./index.dfe99d95.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]="4b2c7ddf-0375-472c-aea9-a6f4882ff07d",t._sentryDebugIdIdentifier="sentry-dbid-4b2c7ddf-0375-472c-aea9-a6f4882ff07d")}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.586bf5f5.js.map
