t-convex-nextjs-saas/src/components/core/ThemeChanger.tsx

15 lines
344 B
TypeScript
Raw Normal View History

2026-03-27 23:15:07 +00:00
"use client";
import { useTheme } from "next-themes";
export const ThemeChanger = () => {
const { theme, setTheme } = useTheme();
return (
<div>
The current theme is: {theme}
<button onClick={() => setTheme("light")}>Light Mode</button>
<button onClick={() => setTheme("dark")}>Dark Mode</button>
</div>
);
};