Spaces:
Sleeping
Sleeping
File size: 648 Bytes
3786a3f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 'use client';
import { Moon, Sun } from 'lucide-react';
import { useTheme } from '@/hooks/useTheme';
import { cn } from '@/lib/utils';
export function ThemeToggle({ className }: { className?: string }) {
const { theme, toggleTheme } = useTheme();
return (
<button
onClick={toggleTheme}
aria-label="Toggle theme"
className={cn(
'inline-flex h-9 w-9 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-elevated hover:text-text-primary',
className
)}
>
{theme === 'dark' ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
</button>
);
}
|