import{d as b,eB as y,G as g,b as _,c as w,u as C}from"./outputWidgets.38a8ba6d.js";import{a as I}from"./asyncComputed.41d10d8a.js";import{a as h}from"./authorManager.b6ced178.js";import"./index.56107642.js";import{M as n}from"./member.7a14f96a.js";import{C as k}from"./CrudView.ba56980c.js";import{C as v}from"./icons.4ae4a9c5.js";import{a as M}from"./ant-design.16790220.js";import"./index.cf4c23b9.js";import"./record.be73334f.js";import"./pubsub.23b14df7.js";import"./gateway.77dbab2f.js";import"./Title.ecd0d354.js";import"./Text.1048f348.js";import"./FormItem.4673de87.js";import"./hasIn.29d88859.js";import"./Form.a08a590c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.5eb5c38c.js";import"./router.558347d5.js";import"./index.8b3fd40e.js";import"./url.1a877628.js";import"./index.0c02607f.js";import"./index.91017c21.js";import"./index.df8e3842.js";import"./index.2785839f.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]="f8bca1a0-a00e-4972-a9eb-26d58097c1d3",t._sentryDebugIdIdentifier="sentry-dbid-f8bca1a0-a00e-4972-a9eb-26d58097c1d3")}catch{}})();const Y=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:u,refetch:m}=I(()=>n.list(a)),f=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"Actions"}],rows:(r=(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=h.getAuthor())==null?void 0:s.claims.email)===o.email?void 0:[{icon:v,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(k,{"entity-name":"members",loading:C(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.2408b91f.js.map
