Files
meditation-admin/app/layout.tsx
T
2026-06-03 09:01:42 +03:30

37 lines
1.2 KiB
TypeScript

import type { Metadata } from "next";
import { Vazirmatn } from "next/font/google";
import { Providers } from "@/components/Providers";
import "./globals.css";
const vazir = Vazirmatn({
variable: "--font-vazir",
subsets: ["arabic", "latin"],
display: "swap",
});
export const metadata: Metadata = {
title: "پنل مدیریت آرام جان",
description: "پنل مدیریت محتوای اپلیکیشن آرام جان",
};
// Runs before paint to set the `.dark` class from saved preference / system,
// avoiding a light flash on load. Kept inline + minimal on purpose.
const noFlashTheme = `(function(){try{var t=localStorage.getItem('aram_theme');if(!t){t=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';}if(t==='dark'){document.documentElement.classList.add('dark');}}catch(e){}})();`;
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="fa" dir="rtl" className={`${vazir.variable} h-full`}>
<head>
<script dangerouslySetInnerHTML={{ __html: noFlashTheme }} />
</head>
<body className="min-h-full">
<Providers>{children}</Providers>
</body>
</html>
);
}