import{d as y,eA as g,H as b,b as _,c as w,u as h,eP as I}from"./outputWidgets.1c4947c7.js";import{a as k}from"./asyncComputed.ab9c45d0.js";import{b as x}from"./router.f814fb07.js";import"./index.bf745b17.js";import{M as n}from"./member.e77e3abe.js";import{C}from"./CrudView.54cbe4c4.js";import{a as v}from"./ant-design.5014c7e6.js";import"./Form.cba5cdce.js";import"./hasIn.58acd238.js";import"./popupNotifcation.bd532d77.js";import"./index.cf4c23b9.js";import"./record.438e3693.js";import"./pubsub.87f1efb9.js";import"./Paragraph.110c4a21.js";import"./Text.4ed32514.js";import"./Modal.5c7e6d3c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.f7859d2d.js";import"./url.ca3e5e32.js";import"./index.a9af7b0b.js";import"./Title.6f4ab7f6.js";import"./index.83f629a7.js";import"./index.2f87ba27.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]="1c573a62-1903-4616-90af-86076b05d276",t._sentryDebugIdIdentifier="sentry-dbid-1c573a62-1903-4616-90af-86076b05d276")}catch{}})();const U=y({__name:"Editors",setup(t){const a=g().params.organizationId,l=[{key:"email",label:"Email"}],d=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:l,onCreate:d},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Editors.ca4bd77f.js.map
