import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.6f145ce0.js";import{a as I}from"./asyncComputed.dd872c81.js";import{b as k}from"./router.10134285.js";import"./index.54c0ce9d.js";import{M as n}from"./member.8a3a2e8e.js";import{C as x}from"./CrudView.494bfc82.js";import{L as C}from"./icons.fe7720e9.js";import{a as v}from"./ant-design.2455b310.js";import"./Form.0febb5d8.js";import"./hasIn.d2967fc5.js";import"./popupNotifcation.c99b8976.js";import"./index.cf4c23b9.js";import"./record.40124f45.js";import"./pubsub.ec1cca0d.js";import"./Paragraph.c2438e5f.js";import"./Base.4c459403.js";import"./Typography.37467e29.js";import"./Modal.07a2474e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.0c489ca9.js";import"./url.361bdab7.js";import"./index.54cc85eb.js";import"./Title.bdc50f8a.js";import"./Text.a320eb97.js";import"./index.63ac5bd0.js";import"./index.c1935091.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]="a7b44647-85cf-4bcb-95d9-9bd5869e0584",t._sentryDebugIdIdentifier="sentry-dbid-a7b44647-85cf-4bcb-95d9-9bd5869e0584")}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.493357de.js.map
