import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.0d6c71c4.js";import{a as I}from"./asyncComputed.27df476d.js";import{b as k}from"./router.e5be387e.js";import"./index.a0d2b41b.js";import{M as n}from"./member.fde822f7.js";import{C as x}from"./CrudView.7208f86a.js";import{K as C}from"./icons.3c0b1217.js";import{a as M}from"./ant-design.ebf753ed.js";import"./Form.4c2d0255.js";import"./hasIn.e6aa186e.js";import"./index.cf4c23b9.js";import"./record.19c12a45.js";import"./pubsub.a3cc160d.js";import"./Paragraph.fa27bd72.js";import"./Base.027fcad1.js";import"./Typography.a1d2ddc8.js";import"./Modal.2b3bb1b6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.ba54ed30.js";import"./url.54f51be3.js";import"./index.79a50c9a.js";import"./Title.773b1396.js";import"./Text.5f5581ee.js";import"./index.c2096d22.js";import"./index.e9940846.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]="5a5c5f4a-39f5-4977-a829-49e5c23ae0b8",t._sentryDebugIdIdentifier="sentry-dbid-5a5c5f4a-39f5-4977-a829-49e5c23ae0b8")}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 p(e){await M("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{X as default};
//# sourceMappingURL=Members.6e790353.js.map
