import{d as y,eB as b,H as g,b as _,c as w,u as h}from"./outputWidgets.3188a019.js";import{a as I}from"./asyncComputed.7b65ee65.js";import{b as k}from"./router.fce6e906.js";import"./index.ada93058.js";import{M as n}from"./member.27c2e22c.js";import{C as x}from"./CrudView.11c8cf76.js";import{K as C}from"./icons.711a251e.js";import{a as v}from"./ant-design.d622d6e4.js";import"./Form.a4ff567f.js";import"./hasIn.f9eb80a7.js";import"./popupNotifcation.216f2062.js";import"./index.cf4c23b9.js";import"./record.c6c89e1c.js";import"./pubsub.b7936f46.js";import"./Paragraph.7aa1831b.js";import"./Base.7f869b4c.js";import"./Typography.e2687acd.js";import"./Modal.4aabbac6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.4279a50f.js";import"./url.3b1c7dd6.js";import"./index.1507f200.js";import"./Title.b20ed6e6.js";import"./Text.bf95915f.js";import"./index.e04abe45.js";import"./index.999e580b.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]="de94a0e9-8f52-43ce-93e3-6ff39c4320ea",t._sentryDebugIdIdentifier="sentry-dbid-de94a0e9-8f52-43ce-93e3-6ff39c4320ea")}catch{}})();const Y=y({__name:"Editors",setup(t){const a=b().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.a36d5705.js.map
