import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.af28e799.js";import{a as I}from"./asyncComputed.b5c1c387.js";import{b as k}from"./router.1c71e909.js";import"./index.da0ed47e.js";import{M as n}from"./member.0935b7d3.js";import{C as x}from"./CrudView.73997f30.js";import{D as C}from"./icons.f637ef04.js";import{a as M}from"./ant-design.d5765e08.js";import"./FormItem.3cdd6f35.js";import"./hasIn.b3665b9b.js";import"./index.cf4c23b9.js";import"./record.e8631664.js";import"./pubsub.77765f07.js";import"./Paragraph.3b796a14.js";import"./Base.9fc088e8.js";import"./Typography.9914ebec.js";import"./Form.a90bb6e2.js";import"./Modal.1a697377.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7282d72e.js";import"./url.5810758c.js";import"./index.4fe7f349.js";import"./Title.f1c7fcfe.js";import"./Text.abf96dfc.js";import"./index.7dc34d3f.js";import"./index.d378dbbb.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]="9e5afb69-f4cd-4724-9fbf-643504dadd2f",t._sentryDebugIdIdentifier="sentry-dbid-9e5afb69-f4cd-4724-9fbf-643504dadd2f")}catch{}})();const Y=b({__name:"Members",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 M("Are you sure you want to remove this member's access?")&&(await n.delete(a,e.authorId),m())}const{loading:p,result:f,refetch:m}=I(()=>n.list(a)),u=g(()=>{var e,r;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(r=(e=f.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:u.value,"create-button-text":"Add members",fields:l,onCreate:d},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Members.b375bafa.js.map
