import{d as b,eB as y,H as g,b as _,c as w,u as h}from"./outputWidgets.6c92e954.js";import{a as I}from"./asyncComputed.a6744f4b.js";import{b as k}from"./router.daec1f4f.js";import"./index.d70f3e11.js";import{M as n}from"./member.1ea7402f.js";import{C as x}from"./CrudView.096f1d35.js";import{K as C}from"./icons.eb9ff229.js";import{a as M}from"./ant-design.21c39eac.js";import"./Form.72892734.js";import"./hasIn.252833b5.js";import"./index.cf4c23b9.js";import"./record.1024814b.js";import"./pubsub.e3166cf5.js";import"./Paragraph.09928799.js";import"./Base.1c8cd5a1.js";import"./Typography.ddb46fbe.js";import"./Modal.09b95803.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9805dcd5.js";import"./url.3097d400.js";import"./index.3500e53c.js";import"./Title.1b72d44e.js";import"./Text.42d18ad1.js";import"./index.33dbdb8c.js";import"./index.8510f685.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]="2833af4d-abf0-4d4d-bdc7-4237a54fca7e",t._sentryDebugIdIdentifier="sentry-dbid-2833af4d-abf0-4d4d-bdc7-4237a54fca7e")}catch{}})();const X=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: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{X as default};
//# sourceMappingURL=Members.40e7dc5a.js.map
