import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.809f1c57.js";import{a as I}from"./asyncComputed.466c4877.js";import{b as k}from"./router.5b895db7.js";import"./index.c651a706.js";import{M as n}from"./member.5ce857a1.js";import{C as x}from"./CrudView.4f9d2631.js";import{K as C}from"./icons.8975fdbd.js";import{a as v}from"./ant-design.6830cf3a.js";import"./Form.023148df.js";import"./hasIn.e1b15717.js";import"./popupNotifcation.0b39d2d3.js";import"./index.cf4c23b9.js";import"./record.41a2948e.js";import"./pubsub.67132179.js";import"./Paragraph.32fc6334.js";import"./Base.4c033746.js";import"./Typography.f29a9c7e.js";import"./Modal.ae5cc76f.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a2ae9439.js";import"./url.638cfb3e.js";import"./index.ee508a43.js";import"./Title.f3656269.js";import"./Text.9d2b2621.js";import"./index.48e1252c.js";import"./index.090bf6ae.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]="148edd63-2e03-49f9-9153-16d5bc8e4bf2",t._sentryDebugIdIdentifier="sentry-dbid-148edd63-2e03-49f9-9153-16d5bc8e4bf2")}catch{}})();const Y=b({__name:"Editors",setup(t){const r=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(r,e.email),m()};async function c(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: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:()=>c(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:f.value,"create-button-text":"Add members",fields:l,onCreate:d},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.16e54cef.js.map
