import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.52d47f16.js";import{a as I}from"./asyncComputed.4c8b6226.js";import{b as k}from"./router.ea56abc1.js";import"./index.b0e912f1.js";import{M as n}from"./member.bb5ebeb5.js";import{C as x}from"./CrudView.f4ed8d29.js";import{D as C}from"./icons.22b07466.js";import{a as M}from"./ant-design.ea71154e.js";import"./FormItem.f8e049e8.js";import"./hasIn.1b3df496.js";import"./index.cf4c23b9.js";import"./record.c6473ef2.js";import"./pubsub.aae16efd.js";import"./Paragraph.358c5b85.js";import"./Base.73331908.js";import"./Typography.3ab66b91.js";import"./Form.7de0f394.js";import"./Modal.4734ef4e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.50955cf6.js";import"./url.0e01f007.js";import"./index.e38634fb.js";import"./Title.55fb2f67.js";import"./Text.1eb3c39b.js";import"./index.8bd5fc6f.js";import"./index.a2414b78.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]="b604013f-9727-4efd-a39a-e36888389d53",t._sentryDebugIdIdentifier="sentry-dbid-b604013f-9727-4efd-a39a-e36888389d53")}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 p(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:c,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:()=>p(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(c),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.4443e2d3.js.map
