import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.c8053a9d.js";import{a as I}from"./asyncComputed.f7e207a4.js";import{b as k}from"./router.c5eb5658.js";import"./index.7b750cfc.js";import{M as n}from"./member.444b5102.js";import{C as x}from"./CrudView.81651cd0.js";import{L as C}from"./icons.9e4059c8.js";import{a as v}from"./ant-design.73b939ff.js";import"./Form.034d9295.js";import"./hasIn.7ae70fa0.js";import"./popupNotifcation.b87aeac6.js";import"./index.cf4c23b9.js";import"./record.c60a7475.js";import"./pubsub.231a79a7.js";import"./Paragraph.68b1de18.js";import"./Base.d9fc6eef.js";import"./Typography.e5f51e32.js";import"./Modal.63744d77.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f912e8a7.js";import"./url.d8c088a2.js";import"./index.5905e3dd.js";import"./Title.ed86be86.js";import"./Text.d464b589.js";import"./index.b514db2b.js";import"./index.f61692c3.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]="a7ebf12f-d059-4281-9384-45fdd26abe08",t._sentryDebugIdIdentifier="sentry-dbid-a7ebf12f-d059-4281-9384-45fdd26abe08")}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 p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:c,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(c),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.1f165d67.js.map
