import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.c849273f.js";import{a as I}from"./asyncComputed.53ec0023.js";import{b as k}from"./router.26178a94.js";import"./index.310e3dd2.js";import{M as n}from"./member.f6e6648e.js";import{C as x}from"./CrudView.d27d00e7.js";import{D as C}from"./icons.5de06bbc.js";import{a as M}from"./ant-design.b086c804.js";import"./FormItem.8767aead.js";import"./hasIn.a09870a7.js";import"./index.cf4c23b9.js";import"./record.7386625d.js";import"./pubsub.4b8cd066.js";import"./Paragraph.9b9c9580.js";import"./Base.f58dc0d7.js";import"./Typography.69f3ca41.js";import"./Form.5ae0aee9.js";import"./Modal.37c66109.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.527e9d50.js";import"./url.acb8fdc2.js";import"./index.d9979e5f.js";import"./Title.c7ac8182.js";import"./Text.4e6778b2.js";import"./index.9b701101.js";import"./index.b316b415.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]="ad029fa5-4185-4bb4-94dd-c3afcab645fc",t._sentryDebugIdIdentifier="sentry-dbid-ad029fa5-4185-4bb4-94dd-c3afcab645fc")}catch{}})();const Y=b({__name:"Members",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 M("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:()=>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:f.value,"create-button-text":"Add members",fields:l,onCreate:c},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Members.62576518.js.map
