import{d as y,eA as b,H as g,b as _,c as w,u as h,eQ as I}from"./outputWidgets.260a3c99.js";import{a as k}from"./asyncComputed.61df0e0c.js";import{b as x}from"./router.c6bba0da.js";import"./index.16d63baf.js";import{M as n}from"./member.4cd879bd.js";import{C}from"./CrudView.9c881ed3.js";import{a as v}from"./ant-design.16592543.js";import"./Form.46e378f9.js";import"./hasIn.8ab3cbf4.js";import"./popupNotifcation.87bdba7f.js";import"./index.cf4c23b9.js";import"./record.608c7c8c.js";import"./pubsub.ab27f2c0.js";import"./Paragraph.482f5128.js";import"./Text.3b774738.js";import"./Modal.6a26a016.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e08dd3ee.js";import"./BookOutlined.9a33e452.js";import"./url.13938513.js";import"./index.34fd2dd9.js";import"./Title.9673e08a.js";import"./index.a74fba23.js";import"./index.30985d18.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]="080b02d3-383b-4390-a16f-6aa662c55ce7",t._sentryDebugIdIdentifier="sentry-dbid-080b02d3-383b-4390-a16f-6aa662c55ce7")}catch{}})();const W=y({__name:"Editors",setup(t){const a=b().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.1c1d97fe.js.map
