import{d as y,eD as b,I as g,b as _,c as w,u as I,eR as h}from"./outputWidgets.a321903e.js";import{a as k}from"./asyncComputed.78ec0807.js";import{b as x}from"./router.2245534d.js";import"./index.579b421e.js";import{M as n}from"./member.480b23d1.js";import{C}from"./CrudView.b2407c91.js";import{a as v}from"./ant-design.d41464a5.js";import"./Form.e0cc6e8e.js";import"./hasIn.62bbbac0.js";import"./popupNotifcation.43dee970.js";import"./record.d39119c8.js";import"./pubsub.df0290b2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.29f4fec4.js";import"./BookOutlined.425445e6.js";import"./url.d108fea5.js";import"./Paragraph.53f5a9bc.js";import"./Text.b25e1b1d.js";import"./Modal.bcb9f272.js";import"./index.fd9a3d7c.js";import"./Title.e1cf3e99.js";import"./index.211632ef.js";import"./index.f18b9a75.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="c139f8a6-924c-4307-9d46-ffcf1b8b3c86",t._sentryDebugIdIdentifier="sentry-dbid-c139f8a6-924c-4307-9d46-ffcf1b8b3c86")}catch{}})();const U=y({__name:"Editors",setup(t){const a=b().params.organizationId,c=[{key:"email",label:"Email"}],l=async e=>{await n.create(a,e.email),s()};async function d(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),s())}const{loading:p,result:f,refetch:s}=k(()=>n.list(a)),u=g(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=f.value)==null?void 0:e.map(o=>{var m;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((m=x.getAuthor())==null?void 0:m.claims.email)===o.email?[]:[{icon:h,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?i:[]}});return(e,i)=>(_(),w(C,{"entity-name":"editors",loading:I(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:u.value,"create-button-text":"Add editors",fields:c,onCreate:l},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Editors.0ec7b0d7.js.map
