import{C as g}from"./CrudView.ea10c7da.js";import{a as d}from"./ant-design.2529b071.js";import{a as b}from"./asyncComputed.ea730548.js";import{d as w,f1 as _,f7 as h,y as I,b as k,c as v,u as x,fd as C}from"./outputWidgets.049ac64d.js";import{a as z}from"./gateway.c0f62b43.js";import"./index.060492c3.js";import{M as n}from"./member.c80f56a4.js";import"./router.2632e2a3.js";import"./Form.8d97bd19.js";import"./hasIn.8c8d3925.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.07720f16.js";import"./BookOutlined.d451bbc7.js";import"./url.bfc1d6a1.js";import"./Modal.dcfdf87a.js";import"./index.dae82177.js";import"./index.2e524e3e.js";import"./popupNotifcation.836c9a92.js";import"./record.5a9ec5fd.js";import"./pubsub.0c3367ed.js";import"./string.3fb102a6.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="91248ec5-b1ed-40d6-9a90-a86777d6f000",o._sentryDebugIdIdentifier="sentry-dbid-91248ec5-b1ed-40d6-9a90-a86777d6f000")}catch{}})();const T=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,c=[{key:"email",label:"Email"}],l=async e=>{await n.create(r,e.email),m()};async function u(e){var t;if(((t=z.getAuthor())==null?void 0:t.claims.email)===e.email&&await d("You are about to remove your own access. You won't be able to access this organization anymore. Are you sure?")){await n.delete(r,e.authorId),await s.push({name:"organizations"});return}await d("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),m())}const{loading:p,result:f,refetch:m}=b(()=>n.list(r)),y=I(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=f.value)==null?void 0:e.map(t=>({key:t.email,cells:[{type:"text",text:t.email},{type:"text",text:t.role},{type:"actions",actions:[{icon:C,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(k(),v(g,{"entity-name":"editors",loading:x(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:c,onCreate:l},null,8,["loading","table"]))}});export{T as default};
//# sourceMappingURL=Editors.efe7259c.js.map
