import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.9a751704.js";import{a as I}from"./asyncComputed.c0b7f526.js";import{b as k}from"./router.2ed86b1e.js";import"./index.1dbbc1f9.js";import{M as n}from"./member.5586a9df.js";import{C as x}from"./CrudView.294fb79e.js";import{L as C}from"./icons.52647ede.js";import{a as v}from"./ant-design.d5cba7d2.js";import"./Form.b9d05841.js";import"./hasIn.c089c9ed.js";import"./index.cf4c23b9.js";import"./record.91b90880.js";import"./pubsub.f352a300.js";import"./Paragraph.ee49e077.js";import"./Base.083cbb66.js";import"./Typography.c485b72c.js";import"./Modal.34cd8ce8.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a42500bf.js";import"./url.a9a0a879.js";import"./index.6edb660d.js";import"./Title.9671cb18.js";import"./Text.0538649f.js";import"./index.b69d7ab2.js";import"./index.9a36e5c2.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]="bb3999a0-9674-4907-b401-5f281b0973f1",t._sentryDebugIdIdentifier="sentry-dbid-bb3999a0-9674-4907-b401-5f281b0973f1")}catch{}})();const X=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(a,e.email),m()};async function p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,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:()=>p(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:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.a0bb4f44.js.map
