import{d as b,eB as y,G as g,b as _,c as w,u as h}from"./outputWidgets.ed48fa42.js";import{a as I}from"./asyncComputed.bb2b1403.js";import{b as k}from"./router.1b12d634.js";import"./index.5e38be4e.js";import{M as n}from"./member.79c5e70b.js";import{C as x}from"./CrudView.2b6e0547.js";import{F as C}from"./icons.92b5bc38.js";import{a as M}from"./ant-design.2e0784cc.js";import"./FormItem.c1c36356.js";import"./hasIn.a220eabf.js";import"./index.60984836.js";import"./index.cf4c23b9.js";import"./record.2ea2ab4d.js";import"./pubsub.90864e85.js";import"./Title.89d211e5.js";import"./Text.b5b9d884.js";import"./Form.471d6bcc.js";import"./Modal.f08a6e4a.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.8c8873a1.js";import"./url.c9588410.js";import"./index.2264b72c.js";import"./index.7ed642ed.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]="1722647c-bc37-4dc9-a6b1-ce373f210ac3",t._sentryDebugIdIdentifier="sentry-dbid-1722647c-bc37-4dc9-a6b1-ce373f210ac3")}catch{}})();const U=b({__name:"Members",setup(t){const a=y().params.organizationId,c=[{key:"email",label:"Email"}],l=async e=>{await n.create(a,e.email),m()};async function d(e){await M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,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:()=>d(o),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:c,onCreate:l},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Members.a5a9774b.js.map
