From 8446b6db22d82eef94a02835b0ebc3c74de56fc5 Mon Sep 17 00:00:00 2001 From: kleap-admin Date: Thu, 15 Jan 2026 13:42:21 +0000 Subject: [PATCH] Update components/theme-debug.tsx --- components/theme-debug.tsx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 components/theme-debug.tsx diff --git a/components/theme-debug.tsx b/components/theme-debug.tsx new file mode 100644 index 0000000..81731d5 --- /dev/null +++ b/components/theme-debug.tsx @@ -0,0 +1,31 @@ +"use client"; + +import { useTheme } from "next-themes"; +import { useEffect, useState } from "react"; + +export function ThemeDebug() { + const { theme, resolvedTheme, systemTheme } = useTheme(); + const [mounted, setMounted] = useState(false); + const [bodyClass, setBodyClass] = useState(""); + + useEffect(() => { + setMounted(true); + }, []); + + useEffect(() => { + if (mounted) { + setBodyClass(document.body.className); + } + }, [theme, mounted]); + + if (!mounted) return null; + + return ( +
+
Theme: {theme}
+
Resolved: {resolvedTheme}
+
System: {systemTheme}
+
Body classes: {bodyClass}
+
+ ); +} \ No newline at end of file