import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.dbd82eb7.js";import{a as I}from"./asyncComputed.35cc7f64.js";import{b as k}from"./router.a2f17c4c.js";import"./index.447cf405.js";import{M as n}from"./member.51997812.js";import{C as x}from"./CrudView.152393ef.js";import{F as C}from"./icons.fd03d9d3.js";import{a as M}from"./ant-design.135584d0.js";import"./FormItem.07260c6b.js";import"./hasIn.0a3acbb0.js";import"./index.cf4c23b9.js";import"./record.a4c5bdc0.js";import"./pubsub.56ebc718.js";import"./Paragraph.1b3bd714.js";import"./Base.9ecb2d1e.js";import"./Form.a9061abd.js";import"./Modal.856041d0.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.230a8eb3.js";import"./url.1be4a3aa.js";import"./index.a1b32efe.js";import"./Title.8245238f.js";import"./Text.2567a5bf.js";import"./index.517bb670.js";import"./index.0b3bc8c9.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]="6fb9163c-b711-42a8-ad30-afb387f58f9b",t._sentryDebugIdIdentifier="sentry-dbid-6fb9163c-b711-42a8-ad30-afb387f58f9b")}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 p(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,result:f,refetch:m}=I(()=>n.list(a)),u=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=f.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(d),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Members.60188f4e.js.map
