import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.f0391a74.js";import{a as I}from"./asyncComputed.363f961e.js";import{b as k}from"./router.9521f915.js";import"./index.13fb7824.js";import{M as n}from"./member.364eb389.js";import{C as x}from"./CrudView.9f2d78f4.js";import{K as C}from"./icons.f7511453.js";import{a as v}from"./ant-design.3b7d3c1c.js";import"./Form.1aee5650.js";import"./hasIn.23612021.js";import"./popupNotifcation.bb922524.js";import"./index.cf4c23b9.js";import"./record.6f7f627d.js";import"./pubsub.73224ce6.js";import"./Paragraph.4c6547df.js";import"./Base.c690457d.js";import"./Typography.2e02df67.js";import"./Modal.7a75e616.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.6af10b5d.js";import"./url.3db2a8aa.js";import"./index.9869cb58.js";import"./Title.18e0b53f.js";import"./Text.3e9cee86.js";import"./index.0e674df9.js";import"./index.8b4d6f50.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]="1fb68a83-8724-4a05-ac91-bb3afe2d2fea",t._sentryDebugIdIdentifier="sentry-dbid-1fb68a83-8724-4a05-ac91-bb3afe2d2fea")}catch{}})();const Y=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 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)),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:()=>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:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.2f3cb47f.js.map
