i18next + react-i18next con es-AR (fuente), es-419, pt-BR y en; el idioma sale del dispositivo (fallback a inglés) y se puede cambiar en Ajustes. La elección se guarda en localStorage y, para el profe, en users.locale. Las validaciones de shared pasan a claves y los errores de la API se traducen por code (con params para límites de plan y cupo). Migrados: layout, Ajustes, auth, PWA y lib/format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import { Link } from '@tanstack/react-router'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { Logo } from '../brand'
|
|
import { Breadcrumb } from './Breadcrumb'
|
|
import { ThemeToggle } from './ThemeToggle'
|
|
import { UserMenu } from './UserMenu'
|
|
|
|
export function Header() {
|
|
const { t } = useTranslation('layout')
|
|
return (
|
|
<header className="sticky top-0 z-40 h-16 w-full border-b border-border bg-background/90 backdrop-blur">
|
|
<div className="mx-auto flex h-full w-full max-w-7xl items-center justify-between px-4 lg:px-6">
|
|
<div className="flex min-w-0 items-center">
|
|
{/* `Link` and not `<a>`: on mobile the logo is the only way back to the
|
|
home screen and an anchor would reload the whole document, losing
|
|
the in-memory state (React Query cache, install event). */}
|
|
<Link to="/" className="flex items-center lg:hidden" aria-label={t('homeLink')}>
|
|
<Logo className="h-8" />
|
|
</Link>
|
|
<Breadcrumb />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
{/* On mobile the theme lives only in Ajustes → Apariencia: in the
|
|
header it took the space next to the avatar for something you
|
|
change once. On desktop there is room for the shortcut. */}
|
|
<div className="hidden lg:block">
|
|
<ThemeToggle />
|
|
</div>
|
|
<UserMenu />
|
|
</div>
|
|
</div>
|
|
</header>
|
|
)
|
|
} |