mirror of
https://github.com/zoo-apps/ZIPs.git
synced 2026-10-30 14:57:22 +00:00
20 lines
536 B
TypeScript
20 lines
536 B
TypeScript
'use client';
|
|
|
|
import { useTheme } from 'next-themes';
|
|
import { Sun, Moon } from 'lucide-react';
|
|
|
|
export function ThemeToggle() {
|
|
const { theme, setTheme } = useTheme();
|
|
|
|
return (
|
|
<button
|
|
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
|
className="p-2 text-muted-foreground hover:text-foreground transition-colors rounded-lg hover:bg-muted"
|
|
aria-label="Toggle theme"
|
|
>
|
|
<Sun className="size-4 hidden dark:block" />
|
|
<Moon className="size-4 block dark:hidden" />
|
|
</button>
|
|
);
|
|
}
|