import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.dd3997b1.js";import{a as I}from"./asyncComputed.1a148b8f.js";import{b as k}from"./router.23ca8c5c.js";import"./index.c9914850.js";import{M as n}from"./member.f94e2f09.js";import{C as x}from"./CrudView.63395425.js";import{L as C}from"./icons.9d0ae195.js";import{a as v}from"./ant-design.8f26fc9d.js";import"./Form.366406d1.js";import"./hasIn.fd08179b.js";import"./popupNotifcation.6af08685.js";import"./index.cf4c23b9.js";import"./record.27251633.js";import"./pubsub.7e2ca77e.js";import"./Paragraph.142c9e94.js";import"./Base.20fd4dfc.js";import"./Typography.c4837fd7.js";import"./Modal.af3bb857.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9cb78b19.js";import"./url.71144004.js";import"./index.d42bac9c.js";import"./Title.95ef7227.js";import"./Text.6383284e.js";import"./index.e703a32a.js";import"./SyncOutlined.092b7f7b.js";import"./index.2fdd3a95.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]="0c389a2f-bd8f-4d01-ab3c-76fbd1cf4087",t._sentryDebugIdIdentifier="sentry-dbid-0c389a2f-bd8f-4d01-ab3c-76fbd1cf4087")}catch{}})();const Z=b({__name:"Editors",setup(t){const a=y().params.organizationId,l=[{key:"email",label:"Email"}],c=async e=>{await n.create(a,e.email),m()};async function d(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:f,refetch:m}=I(()=>n.list(a)),u=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=f.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:()=>d(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:u.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Editors.f884a51b.js.map
