import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.59990c05.js";import{a as I}from"./asyncComputed.8e0b1df8.js";import{b as k}from"./router.a5c5f1f4.js";import"./index.775602e6.js";import{M as n}from"./member.6a550349.js";import{C as x}from"./CrudView.0b388e3e.js";import{D as C}from"./icons.57eb7190.js";import{a as M}from"./ant-design.6dd1fdf4.js";import"./FormItem.bb4c2077.js";import"./hasIn.a77b4ba2.js";import"./index.cf4c23b9.js";import"./record.1da16a3c.js";import"./pubsub.581fae3d.js";import"./Paragraph.e3acb63e.js";import"./Base.98c977f1.js";import"./Typography.164def35.js";import"./Form.7b255263.js";import"./Modal.b7c1fc01.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f9e7d66c.js";import"./url.2d4b3ba8.js";import"./index.13420729.js";import"./Title.27bf4527.js";import"./Text.f3fc4f5d.js";import"./index.b93fafec.js";import"./index.e8d878bf.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]="a66f1ffb-f901-471e-ab98-b5d43655be49",t._sentryDebugIdIdentifier="sentry-dbid-a66f1ffb-f901-471e-ab98-b5d43655be49")}catch{}})();const Y=b({__name:"Members",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],p=async e=>{await n.create(a,e.email),m()};async function c(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:()=>c(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:p},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Members.abb5a738.js.map
