import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.3cdd28c7.js";import{a as I}from"./asyncComputed.332a5b88.js";import{b as k}from"./router.5467eb8b.js";import"./index.5865745d.js";import{M as n}from"./member.b94c7f48.js";import{C as x}from"./CrudView.07dd9fef.js";import{K as C}from"./icons.ffdd6aed.js";import{a as M}from"./ant-design.8974677b.js";import"./Form.27cf2235.js";import"./hasIn.30eadb22.js";import"./index.cf4c23b9.js";import"./record.e9578478.js";import"./pubsub.7b37ae85.js";import"./Paragraph.89c92ab5.js";import"./Base.eac5750e.js";import"./Typography.00ee05b6.js";import"./Modal.efb541d9.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d7c68259.js";import"./url.c3b48238.js";import"./index.08a743a8.js";import"./Title.0e21163b.js";import"./Text.fa88e805.js";import"./index.8c3e090d.js";import"./index.9eaff1fe.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]="1c9ac4bd-8594-4deb-b88e-7524c31c5d25",t._sentryDebugIdIdentifier="sentry-dbid-1c9ac4bd-8594-4deb-b88e-7524c31c5d25")}catch{}})();const X=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{X as default};
//# sourceMappingURL=Members.3783e716.js.map
