import{d as f,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.9bb29762.js";import{a as I}from"./asyncComputed.ac1a0197.js";import{b as k}from"./router.f15646c4.js";import"./index.2f604abe.js";import{M as n}from"./member.9aff3ac2.js";import{C as x}from"./CrudView.8ffa6c50.js";import{L as C}from"./icons.d08bf04b.js";import{a as v}from"./ant-design.3940e065.js";import"./Form.472b1af8.js";import"./hasIn.fa8167cd.js";import"./popupNotifcation.b12790e0.js";import"./index.cf4c23b9.js";import"./record.dd7b0559.js";import"./pubsub.90d4935e.js";import"./Paragraph.9dbf4710.js";import"./Base.abff5e35.js";import"./Typography.184e8c0b.js";import"./Modal.8f9ba470.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.79f00877.js";import"./url.c222fac4.js";import"./index.fcc99b17.js";import"./Title.b342fcc9.js";import"./Text.5324981a.js";import"./index.b2ab466e.js";import"./index.1ce3173e.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]="b7b7b5fa-be25-46f4-b082-aecc9610904b",t._sentryDebugIdIdentifier="sentry-dbid-b7b7b5fa-be25-46f4-b082-aecc9610904b")}catch{}})();const Y=f({__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 p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,result:u,refetch:m}=I(()=>n.list(a)),b=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(d),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:b.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.1dce1fa5.js.map
