import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.23000524.js";import{a as I}from"./asyncComputed.119d5dc7.js";import{b as k}from"./router.863e00fe.js";import"./index.a8f1483f.js";import{M as n}from"./member.edc95889.js";import{C as x}from"./CrudView.6a0995a7.js";import{K as C}from"./icons.4c4e9b27.js";import{a as M}from"./ant-design.a4f77240.js";import"./Form.516b88d2.js";import"./hasIn.28f00305.js";import"./index.cf4c23b9.js";import"./record.fdd32742.js";import"./pubsub.1c155070.js";import"./Paragraph.952d3d60.js";import"./Base.4c280123.js";import"./Typography.05b88506.js";import"./Modal.06e92a54.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.b2945c12.js";import"./url.f1743f94.js";import"./index.a6ee613e.js";import"./Title.4ad9b85b.js";import"./Text.4a706067.js";import"./index.235cb6c6.js";import"./index.12214178.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]="825bc591-e232-45b5-9f8e-64672713b164",t._sentryDebugIdIdentifier="sentry-dbid-825bc591-e232-45b5-9f8e-64672713b164")}catch{}})();const X=b({__name:"Members",setup(t){const r=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(r,e.email),m()};async function p(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:d,result:u,refetch:m}=I(()=>n.list(r)),f=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(a=(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?a:[]}});return(e,a)=>(_(),w(x,{"entity-name":"members",loading:h(d),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.f66bf393.js.map
