import { useNavigate } from 'react-router-dom' import { useTheme, type ThemeMode } from '../contexts/ThemeContext' const sectionStyle: React.CSSProperties = { background: 'var(--bg-3)', borderRadius: 10, padding: '16px 16px', display: 'flex', flexDirection: 'column', gap: 12, } const labelStyle: React.CSSProperties = { color: 'var(--ink-3)', fontSize: 11, fontFamily: 'var(--font-ui)', textTransform: 'uppercase', letterSpacing: 0.5, } const THEME_OPTIONS: { value: ThemeMode; label: string; icon: string }[] = [ { value: 'dark', label: 'Sombre', icon: 'moon' }, { value: 'light', label: 'Clair', icon: 'sun' }, { value: 'system', label: 'Système', icon: 'circle-half-stroke' }, ] const FONT_LABELS: Record = { '0.8': 'XS', '0.85': 'S', '0.9': 'S+', '0.95': 'M-', '1': 'M', '1.05': 'M+', '1.1': 'L-', '1.15': 'L', '1.2': 'L+', '1.25': 'XL', '1.3': 'XL+', '1.35': 'XXL', '1.4': 'XXL+', } export default function ConfigPage() { const navigate = useNavigate() const { theme, setTheme, fontScale, setFontScale } = useTheme() const scaleLabel = FONT_LABELS[String(fontScale)] ?? `${Math.round(fontScale * 100)}%` return (
{/* Titre */}

Paramètres

{/* Thème */}
Thème d'affichage
{THEME_OPTIONS.map(opt => { const active = theme === opt.value return ( ) })}
{/* Taille du texte */}
Taille du texte
A setFontScale(parseFloat(e.target.value))} style={{ flex: 1, accentColor: 'var(--accent)', cursor: 'pointer' }} /> A
{scaleLabel} — {Math.round(fontScale * 100)}% {fontScale !== 1 && ( )}
{/* Aperçu */}
Aperçu du texte principal
Texte secondaire et labels
) }