import{d as y,eB as b,H as g,b as _,c as w,u as h}from"./outputWidgets.143b89ad.js";import{a as I}from"./asyncComputed.fefd676a.js";import{b as k}from"./router.21bbc665.js";import"./index.91c8451e.js";import{M as n}from"./member.52acbbdc.js";import{C as x}from"./CrudView.8ae33a85.js";import{K as C}from"./icons.1edc4453.js";import{a as v}from"./ant-design.10a6d501.js";import"./Form.db0ef3c4.js";import"./hasIn.b5021533.js";import"./popupNotifcation.fb7df8d7.js";import"./index.cf4c23b9.js";import"./record.557e07c4.js";import"./pubsub.b0541584.js";import"./Paragraph.71d9c62e.js";import"./Base.cfb1ba48.js";import"./Typography.cddcecb6.js";import"./Modal.b23c0247.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.ac65b288.js";import"./url.9f8760c3.js";import"./index.54bce458.js";import"./Title.d82cdea3.js";import"./Text.b74e36c5.js";import"./index.dbc476d2.js";import"./index.9d12c88e.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]="afe7d455-06f9-4520-86fa-0dc47c0f67a6",t._sentryDebugIdIdentifier="sentry-dbid-afe7d455-06f9-4520-86fa-0dc47c0f67a6")}catch{}})();const Y=y({__name:"Editors",setup(t){const a=b().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:f,refetch:m}=I(()=>n.list(a)),u=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=f.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:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Editors.30036ef6.js.map
