import{d as b,eB as y,G as g,b as _,c as w,u as I}from"./outputWidgets.470cd725.js";import{a as h}from"./asyncComputed.72d91ef9.js";import{a as k}from"./authorManager.176ccd94.js";import"./index.d44cde0e.js";import{M as n}from"./member.494808c2.js";import{C as v}from"./CrudView.e08250db.js";import{F as C}from"./icons.732210f6.js";import{a as M}from"./ant-design.e0dca437.js";import"./index.cf4c23b9.js";import"./record.19f593f6.js";import"./pubsub.bb7b27fb.js";import"./gateway.6d700df7.js";import"./Title.edbac04b.js";import"./Text.fbb768c7.js";import"./FormItem.bd89e955.js";import"./hasIn.6bd3aa8a.js";import"./Form.bf13abb6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.702cb95e.js";import"./router.bb51d819.js";import"./index.672f7932.js";import"./url.28fafd73.js";import"./index.e48b3db7.js";import"./index.2d4e9800.js";import"./index.52ab7ae6.js";import"./index.ea4d1d9c.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]="c78e4249-cc21-4991-b434-93576cb45b80",t._sentryDebugIdIdentifier="sentry-dbid-c78e4249-cc21-4991-b434-93576cb45b80")}catch{}})();const Y=b({__name:"Members",setup(t){const r=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(r,e.email),m()};async function d(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}=h(()=>n.list(r)),f=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"Actions"}],rows:(a=(e=u.value)==null?void 0:e.map(o=>{var s;return{key:o.email,cells:[{text:o.email},{text:o.role},{text:"",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===o.email?void 0:[{icon:C,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?a:[]}});return(e,a)=>(_(),w(v,{"entity-name":"members",loading:I(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:c},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Members.dbe90462.js.map
