import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.3c3deba7.js";import{a as I}from"./asyncComputed.41e37f4b.js";import{b as k}from"./router.2687a12c.js";import"./index.79fda194.js";import{M as n}from"./member.eba58df5.js";import{C as x}from"./CrudView.44eff915.js";import{L as C}from"./icons.c5a369ef.js";import{a as v}from"./ant-design.a4c10239.js";import"./Form.21b032af.js";import"./hasIn.26cab181.js";import"./index.cf4c23b9.js";import"./record.e2163ce9.js";import"./pubsub.59f66cb7.js";import"./Paragraph.d0a77c93.js";import"./Base.c0a62eaa.js";import"./Typography.828881b4.js";import"./Modal.ace70b58.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.86e502f6.js";import"./url.89508003.js";import"./index.c3c37865.js";import"./Title.ee2bfa7b.js";import"./Text.9ff37267.js";import"./index.66ff16a7.js";import"./index.a5f4fbb0.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]="57a0fb8e-8fc5-4b41-8cbd-88755e54f63d",t._sentryDebugIdIdentifier="sentry-dbid-57a0fb8e-8fc5-4b41-8cbd-88755e54f63d")}catch{}})();const X=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(a,e.email),m()};async function d(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,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:()=>d(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),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:c},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.2498a75d.js.map
