import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.120abcec.js";import{a as I}from"./asyncComputed.e26882e4.js";import{b as k}from"./router.7fe7e9c6.js";import"./index.bbf0dbf0.js";import{M as n}from"./member.d33d3312.js";import{C as x}from"./CrudView.2865f483.js";import{L as C}from"./icons.81fa3ed8.js";import{a as v}from"./ant-design.5df1462b.js";import"./Form.65d5185b.js";import"./hasIn.07231e5c.js";import"./popupNotifcation.89e33f50.js";import"./index.cf4c23b9.js";import"./record.bba37786.js";import"./pubsub.a3533115.js";import"./Paragraph.200bbb6d.js";import"./Base.0deedccd.js";import"./Typography.e89833d8.js";import"./Modal.c436e1a8.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a83146c1.js";import"./url.a71238d7.js";import"./index.983b1ccc.js";import"./Title.2384966a.js";import"./Text.04b2aa2d.js";import"./index.a72a8d18.js";import"./index.51d0c414.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]="597d68d8-1d41-4347-a0e2-ba347055d4c3",t._sentryDebugIdIdentifier="sentry-dbid-597d68d8-1d41-4347-a0e2-ba347055d4c3")}catch{}})();const Y=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{Y as default};
//# sourceMappingURL=Editors.6a7ac214.js.map
