import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.9e8e14b2.js";import{a as I}from"./asyncComputed.855ae5ad.js";import{b as k}from"./router.637c147d.js";import"./index.5f48c045.js";import{M as n}from"./member.7645511d.js";import{C as x}from"./CrudView.580e3ccb.js";import{K as C}from"./icons.2b48c800.js";import{a as M}from"./ant-design.e931d931.js";import"./Form.00575eba.js";import"./hasIn.c9e055df.js";import"./index.cf4c23b9.js";import"./record.ff692408.js";import"./pubsub.95c88303.js";import"./Paragraph.49b33da6.js";import"./Base.8983363c.js";import"./Typography.cc1d898e.js";import"./Modal.6eb7b200.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e19bad92.js";import"./url.eb89a751.js";import"./index.24364211.js";import"./Title.6584a4fc.js";import"./Text.f91b7e81.js";import"./index.06f03adb.js";import"./index.3f01ddfb.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]="1e3827b0-22bd-4350-9a1a-5d846e03ec21",t._sentryDebugIdIdentifier="sentry-dbid-1e3827b0-22bd-4350-9a1a-5d846e03ec21")}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: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{X as default};
//# sourceMappingURL=Members.8f2b7380.js.map
