import{C as g}from"./CrudView.858975e6.js";import{a as m}from"./ant-design.505ee29f.js";import{a as b}from"./asyncComputed.bd2b6e70.js";import{d as w,ey as _,eF as h,y as I,b as k,c as v,u as x,eL as C}from"./outputWidgets.f7b80e9f.js";import{a as z}from"./gateway.58b63376.js";import"./index.f21af923.js";import{M as n}from"./member.8c321696.js";import"./router.6fb3acdf.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.b36f7510.js";import"./BookOutlined.12f9401e.js";import"./url.882128c4.js";import"./index.288a68e3.js";import"./index.86fdb625.js";import"./popupNotifcation.6f5b518c.js";import"./record.188928bf.js";import"./pubsub.10df5fd2.js";import"./string.18a9daee.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]="3c452493-4141-40e5-92d7-102f11283dc6",o._sentryDebugIdIdentifier="sentry-dbid-3c452493-4141-40e5-92d7-102f11283dc6")}catch{}})();const P=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,d=[{key:"email",label:"Email"}],l=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}=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:d,onCreate:l},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.bc0b1e03.js.map
