import{d as b,eA as y,H as g,b as _,c as w,u as h,eP as I}from"./outputWidgets.63450c6a.js";import{a as k}from"./asyncComputed.4686243d.js";import{b as x}from"./router.b1520023.js";import"./index.f9342278.js";import{M as n}from"./member.b8b7fef1.js";import{C}from"./CrudView.6bcc0a2a.js";import{a as v}from"./ant-design.a74b142d.js";import"./Form.bd89de9c.js";import"./hasIn.1b20766f.js";import"./popupNotifcation.ee18d946.js";import"./index.cf4c23b9.js";import"./record.884a3745.js";import"./pubsub.9ff806ef.js";import"./Paragraph.b0baea90.js";import"./Text.3d888762.js";import"./Modal.138f2689.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.336161d1.js";import"./BookOutlined.fe4a32cf.js";import"./url.181b4bfa.js";import"./index.aeb802d2.js";import"./Title.05596582.js";import"./index.078560f6.js";import"./index.080f3c3e.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]="a2727ce0-2be3-41b8-a959-89f0a3db4c3c",t._sentryDebugIdIdentifier="sentry-dbid-a2727ce0-2be3-41b8-a959-89f0a3db4c3c")}catch{}})();const W=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=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:u,refetch:s}=k(()=>n.list(a)),f=g(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=u.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:I,label:"Remove access",onClick:()=>d(o),dangerous:!0}]}]}}))!=null?i:[]}});return(e,i)=>(_(),w(C,{"entity-name":"editors",loading:h(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:f.value,"create-button-text":"Add editors",fields:l,onCreate:c},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.fe5c0cf1.js.map
