import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.cb403911.js";import{a as I}from"./asyncComputed.e79d98d0.js";import{b as k}from"./router.41eccbd6.js";import"./index.d47d8dcd.js";import{M as n}from"./member.fcbb6195.js";import{C as x}from"./CrudView.93290ea8.js";import{K as C}from"./icons.aae3c493.js";import{a as v}from"./ant-design.cd0744b8.js";import"./Form.c4e43409.js";import"./hasIn.fda5345a.js";import"./popupNotifcation.25cc8775.js";import"./index.cf4c23b9.js";import"./record.1cf44d32.js";import"./pubsub.b68b1f2c.js";import"./Paragraph.42173e08.js";import"./Base.e3f83538.js";import"./Typography.1be659fb.js";import"./Modal.8e17ec62.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.2e7aedec.js";import"./url.947a208d.js";import"./index.ee47e378.js";import"./Title.c41b8760.js";import"./Text.685c8d87.js";import"./index.2cd71938.js";import"./index.3f3dd84a.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]="7ee18f55-d774-4d61-8d6f-4dfdde05b6b1",t._sentryDebugIdIdentifier="sentry-dbid-7ee18f55-d774-4d61-8d6f-4dfdde05b6b1")}catch{}})();const Y=b({__name:"Editors",setup(t){const r=y().params.organizationId,d=[{key:"email",label:"Email"}],l=async e=>{await n.create(r,e.email),m()};async function p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:c,result:u,refetch:m}=I(()=>n.list(r)),f=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(a=(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?a:[]}});return(e,a)=>(_(),w(x,{"entity-name":"members",loading:h(c),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:f.value,"create-button-text":"Add members",fields:d,onCreate:l},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.67bef57c.js.map
