import{d as y,eE as g,J as b,b as _,c as w,u as h,eS as I}from"./outputWidgets.f4ff73cb.js";import{a as k}from"./asyncComputed.1c2e733f.js";import{b as x}from"./router.579c91e6.js";import"./index.4ca46dd8.js";import{M as n}from"./member.e7a10b24.js";import{C}from"./CrudView.153891cb.js";import{a as v}from"./ant-design.b167c820.js";import"./Form.c8ea7c3d.js";import"./hasIn.c05f2ad3.js";import"./popupNotifcation.d7d31af4.js";import"./record.06ee4427.js";import"./pubsub.f8e50115.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.273d3e2a.js";import"./BookOutlined.eb157924.js";import"./url.f4aa4fed.js";import"./Paragraph.0762ff9a.js";import"./Base.2cf6cca2.js";import"./Modal.fb9d97fb.js";import"./index.38a388d2.js";import"./Title.8356c432.js";import"./Text.b0ae0f80.js";import"./index.72e9756f.js";import"./index.81bff51e.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]="dcd75269-674d-46c3-9efb-29067783ad20",t._sentryDebugIdIdentifier="sentry-dbid-dcd75269-674d-46c3-9efb-29067783ad20")}catch{}})();const W=y({__name:"Editors",setup(t){const a=g().params.organizationId,d=[{key:"email",label:"Email"}],l=async e=>{await n.create(a,e.email),s()};async function c(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=b(()=>{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:()=>c(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:d,onCreate:l},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Editors.2dde0712.js.map
