import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.91c9f730.js";import{a as I}from"./asyncComputed.5cff1726.js";import{b as k}from"./router.e4c5e9fd.js";import"./index.7bd5dae7.js";import{M as n}from"./member.5d7afdf8.js";import{C as x}from"./CrudView.d1c2398f.js";import{L as C}from"./icons.e854b740.js";import{a as v}from"./ant-design.b392f32d.js";import"./Form.f24a1c0a.js";import"./hasIn.d8588324.js";import"./popupNotifcation.e7a2b93a.js";import"./index.cf4c23b9.js";import"./record.48aae23b.js";import"./pubsub.25829540.js";import"./Paragraph.18e7082b.js";import"./Base.79932679.js";import"./Typography.c7c5698a.js";import"./Modal.41a7632f.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.05ceca6e.js";import"./url.bd840ee9.js";import"./index.5a63d36f.js";import"./Title.69e80303.js";import"./Text.2f03529d.js";import"./index.946fdb2e.js";import"./index.49f61aa4.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]="1182d1f4-50a4-43fe-9db5-b8afadae8ccb",t._sentryDebugIdIdentifier="sentry-dbid-1182d1f4-50a4-43fe-9db5-b8afadae8ccb")}catch{}})();const Y=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{Y as default};
//# sourceMappingURL=Editors.b1dce40b.js.map
