diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 68dee7a..1c38e74 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -16,12 +16,14 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
-
-
-
-
+
+
+
+
{children}
diff --git a/src/components/ThemeToggle.tsx b/src/components/ThemeToggle.tsx
index 8859cb2..3117183 100644
--- a/src/components/ThemeToggle.tsx
+++ b/src/components/ThemeToggle.tsx
@@ -1,69 +1,37 @@
'use client';
-import { useState, useEffect, JSX } from 'react';
+import { useState, useEffect } from 'react';
import { useTheme } from 'next-themes';
+import { Button } from './ui/button';
+import { FiSun, FiMoon } from 'react-icons/fi';
-type ThemeType = 'light' | 'dark' | 'system';
type ThemeToggleProps = {
className?: string;
};
+
export default function ThemeToggle({ className }: ThemeToggleProps) {
const [mounted, setMounted] = useState(false);
- const { theme, setTheme } = useTheme();
+ const { resolvedTheme, setTheme } = useTheme();
useEffect(() => {
setMounted(true);
}, []);
- if (!mounted) {
- return null;
- }
-
- const icons: { [key in ThemeType]: JSX.Element } = {
- light: (
-
- ),
- system: (
-
- ),
- dark: (
-
- )
- };
-
- const themes: Array<{ id: ThemeType; label: string }> = [
- { id: "light" as ThemeType, label: "Switch to light theme" },
- { id: "system" as ThemeType, label: "Switch to system theme" },
- { id: "dark" as ThemeType, label: "Switch to dark theme" },
- ].filter(({ id }) => id !== theme as ThemeType);
+ if (!mounted) return null;
return (
-
-
-
- {themes.map(({ id }) => (
-
- ))}
-
-
+
);
}