import{d as b,eB as y,G as g,b as _,c as w,u as h}from"./outputWidgets.1e038a78.js";import{a as I}from"./asyncComputed.499f8882.js";import{b as k}from"./router.399d85a7.js";import"./index.8620d4ea.js";import{M as n}from"./member.1991d1b3.js";import{C as x}from"./CrudView.15a2f2a4.js";import{F as C}from"./icons.d1aae4c7.js";import{a as M}from"./ant-design.0362b5ba.js";import"./FormItem.542b6ffb.js";import"./hasIn.3b666b8d.js";import"./index.0ed8646e.js";import"./index.cf4c23b9.js";import"./record.c646ebe1.js";import"./pubsub.3f35ef3d.js";import"./Title.0b1584ed.js";import"./Text.44f96dcb.js";import"./Form.573f5dc9.js";import"./Modal.57f7ea40.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e0178d29.js";import"./url.a1386e61.js";import"./index.912bd131.js";import"./index.82135e3d.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]="824b54b3-1e8a-48aa-9313-b87e0a0c2ad6",t._sentryDebugIdIdentifier="sentry-dbid-824b54b3-1e8a-48aa-9313-b87e0a0c2ad6")}catch{}})();const U=b({__name:"Members",setup(t){const o=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(o,e.email),m()};async function d(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(o,e.authorId),m())}const{loading:p,result:u,refetch:m}=I(()=>n.list(o)),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(a=>{var s;return{key:a.email,cells:[{type:"text",text:a.email},{type:"text",text:a.role},{type:"actions",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===a.email?[]:[{icon:C,label:"Remove access",onClick:()=>d(a),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(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:c},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Members.38304a18.js.map
