import{d as b,eB as y,G as g,b as _,c as w,u as h}from"./outputWidgets.3c34606b.js";import{a as I}from"./asyncComputed.8707f293.js";import{b as k}from"./router.56692652.js";import"./index.c3f2d302.js";import{M as n}from"./member.82071d24.js";import{C as x}from"./CrudView.7c2b0e6f.js";import{F as C}from"./icons.e6ec075a.js";import{a as M}from"./ant-design.8f4f3ad4.js";import"./FormItem.895a8678.js";import"./hasIn.01f4de81.js";import"./index.dd5bce3f.js";import"./index.cf4c23b9.js";import"./record.c46cf28f.js";import"./pubsub.28c1e0e3.js";import"./Title.f4855332.js";import"./Text.aa4a1cf1.js";import"./Form.d74c49d4.js";import"./Modal.10b1f4fc.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.36eacc0b.js";import"./url.425cd9cb.js";import"./index.507e77a0.js";import"./index.5cd5e321.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]="f1195b12-b6a6-439f-971b-15ac602df1e2",t._sentryDebugIdIdentifier="sentry-dbid-f1195b12-b6a6-439f-971b-15ac602df1e2")}catch{}})();const U=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:"",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:()=>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:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Members.904d9e61.js.map
