import{d as b,eB as y,G as g,b as _,c as w,u as C}from"./outputWidgets.7bf30641.js";import{a as I}from"./asyncComputed.cf41ff13.js";import{a as h}from"./authorManager.2579db6e.js";import"./index.57187a5b.js";import{M as n}from"./member.f82278ef.js";import{C as k}from"./CrudView.6e0ac531.js";import{C as v}from"./icons.0dd46489.js";import{a as M}from"./ant-design.a887cdff.js";import"./index.cf4c23b9.js";import"./record.476a0b13.js";import"./pubsub.a4e44688.js";import"./gateway.c0fbae58.js";import"./Title.c96c9fa7.js";import"./Text.85465eb9.js";import"./FormItem.e2824bfb.js";import"./hasIn.8de9ce1e.js";import"./Form.b21cc552.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.2e64fa00.js";import"./router.fcf9a14e.js";import"./index.4b554405.js";import"./url.fb476188.js";import"./index.e3ede662.js";import"./index.b7e18901.js";import"./index.e89173ea.js";import"./index.11ada48b.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]="d30d41a0-d6df-426a-a7d2-66123eb891f9",t._sentryDebugIdIdentifier="sentry-dbid-d30d41a0-d6df-426a-a7d2-66123eb891f9")}catch{}})();const Y=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:"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:()=>c(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:d},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Members.d58bd87f.js.map
