import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.5c52fa87.js";import{a as I}from"./asyncComputed.26d9bcc1.js";import{b as k}from"./router.e0fda50a.js";import"./index.ff34804e.js";import{M as n}from"./member.1f9365c1.js";import{C as x}from"./CrudView.6aea262f.js";import{F as C}from"./icons.03282d1d.js";import{a as M}from"./ant-design.5e093646.js";import"./FormItem.eb04c2fc.js";import"./hasIn.f2c6482d.js";import"./index.cf4c23b9.js";import"./record.eec0c608.js";import"./pubsub.5093c187.js";import"./Paragraph.cff93cf2.js";import"./Base.6d1a6939.js";import"./Form.17a01b6e.js";import"./Modal.2c05a20d.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.fa56e270.js";import"./url.8bc1ece1.js";import"./index.0be66a31.js";import"./Title.91b6cec6.js";import"./Text.c9a398d0.js";import"./index.f2d17967.js";import"./index.076f710c.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]="643186e8-2dc0-4b11-80c3-908c0e92163c",t._sentryDebugIdIdentifier="sentry-dbid-643186e8-2dc0-4b11-80c3-908c0e92163c")}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.54a74091.js.map
