From 06b2adcd10811b92b079294dbdab65727ff2015b Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Wed, 29 May 2024 10:01:52 +0530
Subject: =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20perf(deps):=20upgrade=20to=20react?=
 =?UTF-8?q?=2019=20and=20next=20js=2015,=20add=20loading=20screen,=20drop?=
 =?UTF-8?q?=20mangas=20support?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/app/themeManager.jsx | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 src/app/themeManager.jsx

(limited to 'src/app/themeManager.jsx')

diff --git a/src/app/themeManager.jsx b/src/app/themeManager.jsx
new file mode 100644
index 0000000..f33f7b3
--- /dev/null
+++ b/src/app/themeManager.jsx
@@ -0,0 +1,27 @@
+// app/providers.tsx
+"use client";
+
+import { useEffect, useState } from "react";
+import { NextUIProvider } from "@nextui-org/react";
+import { ThemeProvider as NextThemesProvider } from "next-themes";
+
+export function Providers({ children }) {
+	const [isMounted, setIsMounted] = useState(false);
+
+	useEffect(() => {
+		setIsMounted(true);
+	}, []);
+
+	if (!isMounted) {
+		// Render nothing on the server, ensuring HTML consistency
+		return null;
+	}
+
+	return (
+		<NextUIProvider>
+			<NextThemesProvider attribute="class" defaultTheme="dark">
+				{children}
+			</NextThemesProvider>
+		</NextUIProvider>
+	);
+}
-- 
cgit v1.2.3

