| "use client"; |
|
|
| import { Moon, Sun } from "lucide-react"; |
| import { useTheme } from "./theme-provider"; |
| import { Button } from "./ui/button"; |
|
|
| export function ThemeSwitch() { |
| const { toggleTheme } = useTheme(); |
|
|
| return ( |
| <Button |
| variant="ghost" |
| size="icon" |
| onClick={(e) => toggleTheme(e)} |
| className="relative cursor-pointer hover:scale-110 transition-colors hover:bg-accent" |
| aria-label="Toggle theme" |
| > |
| <Sun className="h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> |
| <Moon className="absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> |
| </Button> |
| ); |
| } |
|
|