import{C as y}from"./CrudView.578d12d1.js";import{a as m}from"./ant-design.8fdc4d68.js";import{a as g}from"./asyncComputed.a247f7ca.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.3768b992.js";import{a as C}from"./gateway.462076e6.js";import{M as n}from"./member.6402d498.js";import"./tables.90afbb2a.js";import"./router.51be7747.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.3d2d8abd.js";import"./BookOutlined.47b19a8c.js";import"./url.e1deb4be.js";import"./PhDotsThreeVertical.vue.275520ce.js";import"./Badge.2c8b258e.js";import"./index.aec3e236.js";import"./popupNotifcation.bdafa9de.js";import"./record.51783f01.js";import"./string.8a7fd0be.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]="12b7f642-706b-4cb0-94db-fb2141f080e6",o._sentryDebugIdIdentifier="sentry-dbid-12b7f642-706b-4cb0-94db-fb2141f080e6")}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}=g(()=>n.list(r)),b=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(y,{"entity-name":"editors",loading:x(f),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:b.value,"create-button-text":"Add editors",fields:l,create:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.0048a1c3.js.map
