import{d as y,eB as b,H as g,b as _,c as w,u as h}from"./outputWidgets.ed989e0a.js";import{a as I}from"./asyncComputed.9f78a6df.js";import{b as k}from"./router.5e7d449c.js";import"./index.46777a19.js";import{M as n}from"./member.9dda1fdb.js";import{C as x}from"./CrudView.919cb08b.js";import{K as C}from"./icons.8f8b8d07.js";import{a as v}from"./ant-design.91be1275.js";import"./Form.fe660512.js";import"./hasIn.264c6078.js";import"./popupNotifcation.c17802b7.js";import"./index.cf4c23b9.js";import"./record.f2e811cc.js";import"./pubsub.14278e58.js";import"./Paragraph.4678e06b.js";import"./Base.42a4c5ca.js";import"./Typography.5e43ce25.js";import"./Modal.1ce4fb47.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a2269c93.js";import"./url.7656a70f.js";import"./index.881316ff.js";import"./Title.7eb91981.js";import"./Text.8e13d454.js";import"./index.f09baa6d.js";import"./index.b8ad5c16.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]="fc7eef91-80fe-4111-9e15-d5346cdf8d33",t._sentryDebugIdIdentifier="sentry-dbid-fc7eef91-80fe-4111-9e15-d5346cdf8d33")}catch{}})();const Y=y({__name:"Editors",setup(t){const r=b().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(r,e.email),m()};async function d(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:p,result:f,refetch:m}=I(()=>n.list(r)),u=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(a=(e=f.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:()=>d(o),dangerous:!0}]}]}}))!=null?a:[]}});return(e,a)=>(_(),w(x,{"entity-name":"members",loading:h(p),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.a72a97a7.js.map
