import{d as b,ez as y,F as g,b as _,c as w,u as h}from"./outputWidgets.b00cf7e9.js";import{a as I}from"./asyncComputed.1f0126f2.js";import{b as k}from"./router.7caa92ea.js";import"./index.1aa24eee.js";import{M as n}from"./member.d7b5a561.js";import{C as x}from"./CrudView.2f8fb5c9.js";import{F as C}from"./icons.99873bd8.js";import{a as M}from"./ant-design.2d18431c.js";import"./FormItem.4a1fd62e.js";import"./hasIn.606210e6.js";import"./jwt-decode.esm.74bd4619.js";import"./storage.c80f95dc.js";import"./index.d1e02be5.js";import"./index.cf4c23b9.js";import"./record.2bf8fb00.js";import"./pubsub.b6fbda2c.js";import"./Title.334eceae.js";import"./Text.20fe3ce1.js";import"./Form.dae4e99c.js";import"./Modal.f98e25b2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.1a9808bf.js";import"./url.255821a6.js";import"./index.47033021.js";import"./index.d004fd61.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]="39066eca-e401-4068-bbee-b37b6fdf7182",t._sentryDebugIdIdentifier="sentry-dbid-39066eca-e401-4068-bbee-b37b6fdf7182")}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.b52a10b8.js.map
