42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
"use client";
|
|
import "./globals.css";
|
|
import { FontVazir } from "@/config/font.config";
|
|
import ThemeRegistry from "@/ui/providers/ThemeRegitstry";
|
|
import { CacheProvider } from "@emotion/react";
|
|
import rtlCache from "@/core/theme/rtlCache";
|
|
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
import { AdapterDateFnsJalali } from "@mui/x-date-pickers/AdapterDateFnsJalali";
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { useState } from "react";
|
|
import { Toaster } from "sonner";
|
|
import { queryClientOptionsData } from "@/core/constant";
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
const [queryClient] = useState(() => new QueryClient(queryClientOptionsData));
|
|
|
|
return (
|
|
<html
|
|
lang="fa"
|
|
dir="rtl"
|
|
className={`${FontVazir.variable} ${FontVazir.className} h-full antialiased`}
|
|
style={{ fontFamily: FontVazir.style.fontFamily }}
|
|
>
|
|
<body className="min-h-full flex flex-col">
|
|
<QueryClientProvider client={queryClient}>
|
|
<CacheProvider value={rtlCache}>
|
|
<ThemeRegistry>
|
|
<LocalizationProvider dateAdapter={AdapterDateFnsJalali}>
|
|
{children}
|
|
<Toaster position="bottom-right" richColors />
|
|
</LocalizationProvider>
|
|
</ThemeRegistry>
|
|
</CacheProvider>
|
|
</QueryClientProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|