import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.d6771bd9.js";import{a as I}from"./asyncComputed.80d29ea0.js";import{b as k}from"./router.37b12b93.js";import"./index.9a22ad51.js";import{M as n}from"./member.18a4b3bd.js";import{C as x}from"./CrudView.86abcaac.js";import{L as C}from"./icons.cbca2df4.js";import{a as v}from"./ant-design.4eefe98e.js";import"./Form.9219dd96.js";import"./hasIn.0e8dd531.js";import"./popupNotifcation.2eab21e1.js";import"./index.cf4c23b9.js";import"./record.d1488526.js";import"./pubsub.5586b81f.js";import"./Paragraph.43dd6508.js";import"./Base.0ee41a7c.js";import"./Typography.0310f653.js";import"./Modal.c04788fa.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e9b8a5cf.js";import"./url.476008e4.js";import"./index.3d271e06.js";import"./Title.47214a2f.js";import"./Text.d26a4614.js";import"./index.d957dad1.js";import"./SyncOutlined.3fd76732.js";import"./index.da9a5f74.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]="6cb3c346-f5d5-4959-8367-fafa93c0e650",t._sentryDebugIdIdentifier="sentry-dbid-6cb3c346-f5d5-4959-8367-fafa93c0e650")}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 p(e){await v("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:d,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:()=>p(o),dangerous:!0}]}]}}))!=null?r:[]}});return(e,r)=>(_(),w(x,{"entity-name":"members",loading:h(d),title:"Organization members",description:"List all organization members.","empty-title":"No members yet",table:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Z as default};
//# sourceMappingURL=Editors.87cf74a8.js.map
