import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.0ce95940.js";import{a as I}from"./asyncComputed.ccac9f92.js";import{b as k}from"./router.fec959cf.js";import"./index.e913c219.js";import{M as n}from"./member.eb661227.js";import{C as x}from"./CrudView.e002c4ac.js";import{K as C}from"./icons.cafa1f54.js";import{a as v}from"./ant-design.cbe0de76.js";import"./Form.547e350f.js";import"./hasIn.8e0662ea.js";import"./popupNotifcation.3fea40a8.js";import"./index.cf4c23b9.js";import"./record.1e618d23.js";import"./pubsub.4ef12c55.js";import"./Paragraph.dc1a70e8.js";import"./Base.e295a40d.js";import"./Typography.b54fb2d7.js";import"./Modal.7a6938e2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.81059274.js";import"./url.1acc4d8d.js";import"./index.aeb4b08a.js";import"./Title.73569f00.js";import"./Text.27a9b167.js";import"./index.dc36cf54.js";import"./index.b5480ed9.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]="27d3de98-dca7-4d06-91b8-c04dc46e36a5",t._sentryDebugIdIdentifier="sentry-dbid-27d3de98-dca7-4d06-91b8-c04dc46e36a5")}catch{}})();const Y=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(a,e.email),m()};async function c(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:()=>c(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:d},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.4b68f543.js.map
