import{d as b,eB as y,G as g,b as _,c as w,u as h}from"./outputWidgets.0c4e4661.js";import{a as I}from"./asyncComputed.5f444091.js";import{b as k}from"./router.6a327cd1.js";import"./index.29479f55.js";import{M as n}from"./member.e10dcfc6.js";import{C as x}from"./CrudView.030e77ce.js";import{F as C}from"./icons.d6072388.js";import{a as M}from"./ant-design.a14ac58b.js";import"./FormItem.16053930.js";import"./hasIn.c776179d.js";import"./index.3ab3d6e8.js";import"./index.cf4c23b9.js";import"./record.2fdce707.js";import"./pubsub.459a9503.js";import"./Title.0df8cfae.js";import"./Text.fd757b8d.js";import"./Form.281f433b.js";import"./Modal.8e447860.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.bda1e74e.js";import"./url.f50daeb8.js";import"./index.b4057846.js";import"./index.92287c89.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]="303da38b-33cd-468f-a95a-923d8abaf1f2",t._sentryDebugIdIdentifier="sentry-dbid-303da38b-33cd-468f-a95a-923d8abaf1f2")}catch{}})();const U=b({__name:"Members",setup(t){const o=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(o,e.email),m()};async function c(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:()=>c(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:d},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Members.4410a9e4.js.map
