import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.763535ec.js";import{a as I}from"./asyncComputed.c1b5752d.js";import{b as k}from"./router.4c31abb0.js";import"./index.e272e65d.js";import{M as n}from"./member.f99bdfd3.js";import{C as x}from"./CrudView.0261ff81.js";import{L as C}from"./icons.39d7577b.js";import{a as v}from"./ant-design.a18872e6.js";import"./Form.93c1d68a.js";import"./hasIn.c3ad9d17.js";import"./popupNotifcation.59a7179b.js";import"./index.cf4c23b9.js";import"./record.ae98c277.js";import"./pubsub.e128dec2.js";import"./Paragraph.1d14da40.js";import"./Base.0423a633.js";import"./Typography.3b9809ab.js";import"./Modal.33014e22.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.0d674672.js";import"./url.0280fc81.js";import"./index.5c5eefcc.js";import"./Title.b6a28a5f.js";import"./Text.1de1f1d2.js";import"./index.351b265c.js";import"./SyncOutlined.cf45cade.js";import"./index.2b7322fb.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]="88ced11a-f3f6-497d-9d3b-1806c76ed4d5",t._sentryDebugIdIdentifier="sentry-dbid-88ced11a-f3f6-497d-9d3b-1806c76ed4d5")}catch{}})();const Z=b({__name:"Editors",setup(t){const r=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(r,e.email),m()};async function c(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:p,result:u,refetch:m}=I(()=>n.list(r)),f=g(()=>{var e,a;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(a=(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?a:[]}});return(e,a)=>(_(),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{Z as default};
//# sourceMappingURL=Editors.c1abf897.js.map
