import{C as b}from"./CrudView.429e2094.js";import{a as m}from"./ant-design.f4783dac.js";import{a as g}from"./asyncComputed.7ed124a4.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.fb72f334.js";import{a as z}from"./gateway.9d0e9a56.js";import"./index.6110cacc.js";import{M as n}from"./member.5a09d7e7.js";import"./router.775ef26f.js";import"./Form.829a2cd2.js";import"./hasIn.ebbb1eda.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.96c0e5a0.js";import"./BookOutlined.6eee3e13.js";import"./url.14a615f7.js";import"./Modal.082f2dc7.js";import"./index.5b13efd4.js";import"./index.dfe8732f.js";import"./popupNotifcation.d53949ca.js";import"./record.7e471bce.js";import"./pubsub.b6388b69.js";import"./string.8f29ec33.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]="5e2261cc-445e-4645-9bab-1188086c7d19",o._sentryDebugIdIdentifier="sentry-dbid-5e2261cc-445e-4645-9bab-1188086c7d19")}catch{}})();const T=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(r,e.email),c()};async function u(e){var t;if(((t=z.getAuthor())==null?void 0:t.claims.email)===e.email&&await m("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 m("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),c())}const{loading:p,result:f,refetch:c}=g(()=>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(b,{"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:l,onCreate:d},null,8,["loading","table"]))}});export{T as default};
//# sourceMappingURL=Editors.6755aac9.js.map
