| 1234567891011121314151617181920 |
- import { Moon, Sun } from 'lucide-react';
- import { useTheme } from '@/contexts/ThemeContext';
- export default function ThemeSwitcher() {
- const { theme, toggleTheme } = useTheme();
- return (
- <button
- onClick={toggleTheme}
- className="p-2 rounded-md transition-colors hover:bg-gray-100"
- title={theme === 'light' ? 'Switch to dark mode' : 'Switch to light mode'}
- >
- {theme === 'light' ? (
- <Moon className="h-5 w-5" />
- ) : (
- <Sun className="h-5 w-5" />
- )}
- </button>
- );
- }
|