import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.23a77d09.js";import{a as I}from"./asyncComputed.87bcbfab.js";import{b as k}from"./router.5013253c.js";import"./index.fb6a8be1.js";import{M as n}from"./member.bb26838f.js";import{C as x}from"./CrudView.a71d1967.js";import{L as C}from"./icons.7faba5d8.js";import{a as v}from"./ant-design.7692a78f.js";import"./Form.1abced8c.js";import"./hasIn.897d62dc.js";import"./popupNotifcation.8aa8d2a6.js";import"./index.cf4c23b9.js";import"./record.99cdbef5.js";import"./pubsub.a21150d7.js";import"./Paragraph.a35411f7.js";import"./Base.a26f807d.js";import"./Typography.d216066f.js";import"./Modal.e2700fe9.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.eb5c86c6.js";import"./url.9d816829.js";import"./index.869792c3.js";import"./Title.61f38aef.js";import"./Text.bfbdf9cf.js";import"./index.34e34ded.js";import"./index.c9455a12.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]="7f5b1271-8db0-410a-a203-8406f3ed22d7",t._sentryDebugIdIdentifier="sentry-dbid-7f5b1271-8db0-410a-a203-8406f3ed22d7")}catch{}})();const Y=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 p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:c,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(c),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.dd9b79b3.js.map
