import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.108432da.js";import{a as I}from"./asyncComputed.9818a09a.js";import{b as k}from"./router.2ffebeb2.js";import"./index.23178e03.js";import{M as n}from"./member.11c6cd91.js";import{C as x}from"./CrudView.a9daec59.js";import{L as C}from"./icons.9db31d3d.js";import{a as v}from"./ant-design.4dbd5b92.js";import"./Form.a76f1164.js";import"./hasIn.7973e16b.js";import"./index.cf4c23b9.js";import"./record.15041cf5.js";import"./pubsub.98ab975f.js";import"./Paragraph.d17409a8.js";import"./Base.f7c93d8e.js";import"./Typography.6afbacd7.js";import"./Modal.efcd7ec2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.c535f159.js";import"./url.42281f8e.js";import"./index.3d290fbb.js";import"./Title.98d4c800.js";import"./Text.1a62e50a.js";import"./index.5578279a.js";import"./index.a196927e.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]="4989321a-241c-4bdf-8f07-903de60b6dda",t._sentryDebugIdIdentifier="sentry-dbid-4989321a-241c-4bdf-8f07-903de60b6dda")}catch{}})();const X=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 c(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:()=>c(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:d},null,8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Editors.4747738f.js.map
