import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.25dce6ef.js";import{a as I}from"./asyncComputed.a16c4c65.js";import{b as k}from"./router.e51f5f97.js";import"./index.9de01bc6.js";import{M as n}from"./member.bc8b08c7.js";import{C as x}from"./CrudView.95230a58.js";import{K as C}from"./icons.7960dc02.js";import{a as v}from"./ant-design.111a07e6.js";import"./Form.3655a4e5.js";import"./hasIn.e0d864a0.js";import"./popupNotifcation.c74dae43.js";import"./index.cf4c23b9.js";import"./record.7f3a448e.js";import"./pubsub.d8283e38.js";import"./Paragraph.fadf37c7.js";import"./Base.fa280ef3.js";import"./Typography.339a5435.js";import"./Modal.69a1b2db.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.049638d2.js";import"./url.79cbe7ef.js";import"./index.fc4c597e.js";import"./Title.83602e90.js";import"./Text.b67c302b.js";import"./index.7c4562af.js";import"./index.bd52bba7.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]="0e988989-c094-4449-ab86-7cb64065b291",t._sentryDebugIdIdentifier="sentry-dbid-0e988989-c094-4449-ab86-7cb64065b291")}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 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{Y as default};
//# sourceMappingURL=Editors.f533c1e7.js.map
