theme.keycloak.v2.admin.resources.assets.MembersModal-CiM-HKQc.js Maven / Gradle / Ivy
import{jsx as a}from"react/jsx-runtime";import{useState as M}from"react";import{u as F,a as S,f as b,M as w,q as g,i as o,aC as l}from"./main-C7ps2lmX.js";import{L as k}from"./PaginatingTableToolbar-Cjsz5Jh4.js";import{K as N,d as U}from"./KeycloakDataTable-DbY4la1D.js";const x=({membersQuery:c,onAdd:m,onClose:t})=>{const{adminClient:d}=F(),{t:e}=S(),{addError:u}=b(),[y,p]=M([]),f=async(r,n,h)=>{const i=await c(),K={first:r,max:n+i.length,search:h||""};try{const s=await d.users.find({...K});return U(s,i,"id").slice(0,n)}catch(s){return u("noUsersFoundError",s),[]}};return a(w,{variant:g.large,title:e("addMember"),isOpen:!0,onClose:t,actions:[a(o,{"data-testid":"add",variant:"primary",onClick:async()=>{await m(y),t()},children:e("add")},"confirm"),a(o,{"data-testid":"cancel",variant:"link",onClick:t,children:e("cancel")},"cancel")],children:a(N,{loader:f,isPaginated:!0,ariaLabelKey:"titleUsers",searchPlaceholderKey:"searchForUser",canSelectAll:!0,onSelect:r=>p([...r]),emptyState:a(k,{message:e("noUsersFound"),instructions:e("emptyInstructions")}),columns:[{name:"username",displayKey:"username"},{name:"email",displayKey:"email"},{name:"lastName",displayKey:"lastName",cellFormatters:[l()]},{name:"firstName",displayKey:"firstName",cellFormatters:[l()]}]})})};export{x as M};
//# sourceMappingURL=MembersModal-CiM-HKQc.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy