import{C as g}from"./CrudView.f5a5d8e5.js";import{a as m}from"./ant-design.57bf02d4.js";import{a as b}from"./asyncComputed.b83fe47e.js";import{d as w,ea as _,eo as h,f as I,o as k,c as v,u as x,ep as z}from"./vue-router.9fdef1c2.js";import{a as C}from"./gateway.48c2d7b1.js";import{M as n}from"./member.ab9b038b.js";import"./tables.86324cd4.js";import"./router.d2ac8bec.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.1284f4cc.js";import"./BookOutlined.510e5f39.js";import"./url.07fafc3a.js";import"./PhDotsThreeVertical.vue.1dec2e66.js";import"./Badge.4a06ddb5.js";import"./index.dc55511c.js";import"./popupNotifcation.894bbaa5.js";import"./record.5ebff19c.js";import"./string.aab27b65.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]="1cf898df-1c78-493f-b185-4021213a5252",o._sentryDebugIdIdentifier="sentry-dbid-1cf898df-1c78-493f-b185-4021213a5252")}catch{}})();const P=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=C.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:f,result:p,refetch:c}=b(()=>n.list(r)),y=I(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=p.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:z,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(k(),v(g,{"entity-name":"editors",loading:x(f),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:l,create:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.c7554b77.js.map
