diyaa.de/app/layout.tsx
2026-03-13 03:16:25 +01:00

32 lines
893 B
TypeScript

import type { Metadata } from "next";
import type { ReactNode } from "react";
import "./globals.css";
export const metadata: Metadata = {
title: "diyaa | Personal Website",
description: "Bilingual personal website built with Next.js",
};
const themeScript = `
(() => {
try {
const storedTheme = localStorage.getItem("theme");
const activeTheme = storedTheme === "light" || storedTheme === "dark" ? storedTheme : "dark";
document.documentElement.setAttribute("data-theme", activeTheme);
} catch {
document.documentElement.setAttribute("data-theme", "dark");
}
})();
`;
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="ar" data-theme="dark" suppressHydrationWarning>
<head>
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
</head>
<body>{children}</body>
</html>
);
}