import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.503b5a9e.js";import{a as I}from"./asyncComputed.f38b9d8f.js";import{b as k}from"./router.51aa7056.js";import"./index.415e508c.js";import{M as n}from"./member.0245ad8f.js";import{C as x}from"./CrudView.8215f03b.js";import{L as C}from"./icons.623e5b2a.js";import{a as v}from"./ant-design.e1bc2e19.js";import"./Form.6709fcbf.js";import"./hasIn.8f49de2e.js";import"./popupNotifcation.d55d8262.js";import"./index.cf4c23b9.js";import"./record.3ffddda0.js";import"./pubsub.2a2a572f.js";import"./Paragraph.eecb906a.js";import"./Base.e395406f.js";import"./Typography.bd2876f7.js";import"./Modal.f99bc7ef.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.98eda1bf.js";import"./url.f247c0b7.js";import"./index.d8ff7290.js";import"./Title.fc9871d6.js";import"./Text.f7ffa2fe.js";import"./index.1289db45.js";import"./SyncOutlined.60f5ac51.js";import"./index.5e395b76.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="27eb08c6-81d6-4339-8ad4-a18b165579d2",t._sentryDebugIdIdentifier="sentry-dbid-27eb08c6-81d6-4339-8ad4-a18b165579d2")}catch{}})();const Z=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(a,e.email),m()};async function c(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,result:u,refetch:m}=I(()=>n.list(a)),f=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=u.value)==null?void 0:e.map(o=>{var s;return{key:o.email,cells:[{type:"text",text:o.email},{type:"text",text:o.role},{type:"actions",actions:((s=k.getAuthor())==null?void 0:s.claims.email)===o.email?[]:[{icon:C,label:"Remove access",onClick:()=>c(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(p),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:f.value,"create-button-text":"Add members",fields:l,onCreate:d},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Editors.2bf44d79.js.map
