import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.6bfc0239.js";import{a as I}from"./asyncComputed.21831dee.js";import{b as k}from"./router.979769f7.js";import"./index.76d87691.js";import{M as n}from"./member.a98b4f76.js";import{C as x}from"./CrudView.26794284.js";import{L as C}from"./icons.5f4f8713.js";import{a as v}from"./ant-design.bf757549.js";import"./Form.7d1a8597.js";import"./hasIn.42df2c7d.js";import"./index.cf4c23b9.js";import"./record.dbb754fe.js";import"./pubsub.56f48661.js";import"./Paragraph.100fbd75.js";import"./Base.3f4f4c87.js";import"./Typography.7fe49268.js";import"./Modal.9595e4e0.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.77240f7b.js";import"./url.c2408bab.js";import"./index.60dad040.js";import"./Title.84d6428e.js";import"./Text.3be64ce1.js";import"./index.ecc37a00.js";import"./index.71301f31.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]="34aa16b6-80ef-4673-8c5e-c1bbad527b6a",t._sentryDebugIdIdentifier="sentry-dbid-34aa16b6-80ef-4673-8c5e-c1bbad527b6a")}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 d(e){await v("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:l,onCreate:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.6e73bbaa.js.map
