Initial commit

This commit is contained in:
Olivier CROGUENNEC
2026-06-13 14:57:15 +02:00
commit 48ed7fe65e
209 changed files with 49979 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { useTheme } from '../context/ThemeContext.jsx';
const OPTIONS = [
{ mode: 'light', icon: '☀', label: 'Clair' },
{ mode: 'dark', icon: '☾', label: 'Sombre' },
{ mode: 'system', icon: '◐', label: 'Système' },
];
export default function ThemeSwitcher() {
const { mode, setMode } = useTheme();
return (
<div className="theme-switcher" role="group" aria-label="Thème">
{OPTIONS.map(o => (
<button
key={o.mode}
type="button"
className={mode === o.mode ? 'active' : ''}
onClick={() => setMode(o.mode)}
title={o.label}
aria-pressed={mode === o.mode}
>
<span aria-hidden="true">{o.icon}</span>
<span>{o.label}</span>
</button>
))}
</div>
);
}