diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 8a2d3cd..a0ef013 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -1,11 +1,13 @@ import { useState } from 'react' import { AuthProvider, useAuth } from './auth/AuthContext' import { LoginPage } from './auth/LoginPage' +import { ChangePasswordPage } from './auth/ChangePasswordPage' import { TabBar, type TabKey } from './components/TabBar' import { InsumosSection } from './components/InsumosSection' import { FormulasSection } from './components/FormulasSection' import { CalculadoraSection } from './components/CalculadoraSection' import { HistorySection } from './components/HistorySection' +import { UsersAdminPage } from './components/UsersAdminPage' import { SaveIndicator } from './components/SaveIndicator' import { usePersistedState } from './hooks/usePersistedState' import { makeDefaultAppState, makeEmptyAppState } from './data/defaults' @@ -22,6 +24,7 @@ function AppRouter() { const { user, loading } = useAuth() if (loading) return if (!user) return + if (user.mustChangePassword) return return } @@ -46,6 +49,8 @@ function AuthenticatedApp() { } } + const isAdmin = user?.isAdmin ?? false + return (
@@ -56,6 +61,11 @@ function AuthenticatedApp() {

{user?.username ?? ''} + {isAdmin && ( + + admin + + )} {' · '} Lineage 2 — Interlude / Clásico

@@ -93,7 +103,7 @@ function AuthenticatedApp() {
- +
@@ -107,6 +117,7 @@ function AuthenticatedApp() { )} {tab === 'historial' && } + {tab === 'usuarios' && isAdmin && }