import{d as b,eB as y,G as g,b as _,c as w,u as I}from"./outputWidgets.781e41f9.js";import{a as h}from"./asyncComputed.d06d5356.js";import{a as k}from"./authorManager.2805bec3.js";import"./index.fc2f40fb.js";import{M as n}from"./member.ed53bda9.js";import{C as v}from"./CrudView.331f38ea.js";import{F as C}from"./icons.0ffc383b.js";import{a as M}from"./ant-design.e0bbd844.js";import"./index.cf4c23b9.js";import"./record.71f43d7d.js";import"./pubsub.2273fc34.js";import"./Title.bf1f8106.js";import"./Text.6168f33a.js";import"./FormItem.341ebdb6.js";import"./hasIn.205b6afa.js";import"./Form.a1506234.js";import"./Modal.3a32e945.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.942344e3.js";import"./router.2dba10c4.js";import"./index.db0f7a49.js";import"./url.a0d7eae0.js";import"./index.0ad8ad84.js";import"./index.574af34c.js";import"./index.b2c1bb4a.js";import"./index.609ad91a.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]="099fb046-40ef-456e-8437-d675a7d40406",t._sentryDebugIdIdentifier="sentry-dbid-099fb046-40ef-456e-8437-d675a7d40406")}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}=h(()=>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=k.getAuthor())==null?void 0:s.claims.email)===o.email?void 0:[{icon:C,label:"Remove access",onClick:()=>c(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),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:d},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Members.8f5d1f03.js.map
