import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.ef7f3407.js";import{a as I}from"./asyncComputed.352c228a.js";import{b as k}from"./router.bb5913c7.js";import"./index.e05ba064.js";import{M as n}from"./member.e9ca567d.js";import{C as x}from"./CrudView.623f4bd3.js";import{L as C}from"./icons.c4e300ba.js";import{a as v}from"./ant-design.f3720243.js";import"./Form.657b35f5.js";import"./hasIn.2b606bf1.js";import"./index.cf4c23b9.js";import"./record.2e6ff048.js";import"./pubsub.b4b207c2.js";import"./Paragraph.7f2d959b.js";import"./Base.00784e3c.js";import"./Typography.56b07efe.js";import"./Modal.bf1b2b77.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.853bcb44.js";import"./url.d258a57b.js";import"./index.030a4369.js";import"./Title.1adff754.js";import"./Text.361a5f7a.js";import"./index.edf02e38.js";import"./index.f158f070.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]="10d33802-ffee-4bef-9df0-874c2f8d4435",t._sentryDebugIdIdentifier="sentry-dbid-10d33802-ffee-4bef-9df0-874c2f8d4435")}catch{}})();const X=b({__name:"Editors",setup(t){const r=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(r,e.email),m()};async function c(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:p,result:f,refetch:m}=I(()=>n.list(r)),u=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(a=(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?a:[]}});return(e,a)=>(_(),w(x,{"entity-name":"members",loading:h(p),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:u.value,"create-button-text":"Add members",fields:l,onCreate:d},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.eb73d665.js.map
