feat: Add theme toggle, implement interactive simulator menu, and enhance dashboard stats API.

This commit is contained in:
2025-12-22 23:34:27 -05:00
parent 2e415d1897
commit dae7926eaa
12 changed files with 483 additions and 280 deletions

View File

@@ -0,0 +1,38 @@
"use client";
import * as React from "react";
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
export function ThemeToggle() {
const { theme, setTheme } = useTheme();
const [mounted, setMounted] = React.useState(false);
// Avoid hydration mismatch
React.useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return (
<div className="w-10 h-10 rounded-xl bg-white/5 border border-white/10" />
);
}
return (
<button
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
className="w-10 h-10 rounded-xl bg-white/5 border border-white/10 flex items-center justify-center text-slate-400 hover:text-white hover:bg-white/10 transition-all duration-300 group relative overflow-hidden"
aria-label="Toggle theme"
>
<div className="absolute inset-0 bg-gradient-to-br from-sky-500/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity" />
<div className="relative z-10">
{theme === "dark" ? (
<Sun className="w-5 h-5 animate-in zoom-in duration-300" />
) : (
<Moon className="w-5 h-5 animate-in zoom-in duration-300" />
)}
</div>
</button>
);
}