All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.UserProfileContext-BX1nihnb.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
import{jsx as U}from"react/jsx-runtime";import{useState as r}from"react";import{e7 as h,u as p,c as x,f as y,a as A,v as S,j,e8 as E}from"./index-C1LIsRX7.js";const u=h("UserProfileContext",void 0),w=({children:i})=>{const{adminClient:t}=p(),{realm:o}=x(),{addAlert:c,addError:l}=y(),{t:f}=A(),[d,m]=r(null),[a,P]=r(0),[v,e]=r(!1);S(()=>t.users.getProfile({realm:o}),s=>m(s),[a]);const g=async(s,n)=>{e(!0);try{return await t.users.updateProfile({...s,realm:o}),e(!1),P(a+1),c(f(n?.successMessageKey??"userProfileSuccess"),j.success),!0}catch(C){return e(!1),l(n?.errorMessageKey??"userProfileError",C),!1}};return U(u.Provider,{value:{config:d,save:g,isSaving:v},children:i})},F=()=>E(u);export{w as U,F as u};
//# sourceMappingURL=UserProfileContext-BX1nihnb.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy