| import { Moon, Sun } from "lucide-react"; | |
| import { Button } from "@/components/ui/button"; | |
| import { useTheme } from "./ThemeProvider"; | |
| export function ThemeToggle() { | |
| const { theme, setTheme } = useTheme(); | |
| return ( | |
| <Button | |
| variant="ghost" | |
| size="icon" | |
| onClick={() => setTheme(theme === "dark" ? "light" : "dark")} | |
| className="rounded-full" | |
| > | |
| {theme === "dark" ? ( | |
| <Sun className="h-5 w-5 text-yellow-400" /> | |
| ) : ( | |
| <Moon className="h-5 w-5 text-violet-dark" /> | |
| )} | |
| <span className="sr-only">Changer le thème</span> | |
| </Button> | |
| ); | |
| } | |