41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { GeistSans } from "geist/font/sans";
|
|
import { GeistMono } from "geist/font/mono";
|
|
|
|
import { Providers } from "@/components/providers";
|
|
import "./globals.css";
|
|
|
|
export const metadata: Metadata = {
|
|
title: {
|
|
template: "%s · Lottery Admin",
|
|
default: "Lottery Admin",
|
|
},
|
|
description: "Lottery administration console",
|
|
};
|
|
|
|
/** 在 React 水合前恢复 `<html lang>`,避免刷新后先闪中文再切换 */
|
|
const ADMIN_LOCALE_BOOTSTRAP = `(function(){try{var s=localStorage.getItem("lottery_admin_ui_locale");var m={zh:"zh-Hans",en:"en",ne:"ne"};if(s&&m[s])document.documentElement.lang=m[s];}catch(e){}})();`;
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
return (
|
|
<html
|
|
lang="zh-Hans"
|
|
suppressHydrationWarning
|
|
className={`${GeistSans.variable} ${GeistMono.variable} h-full antialiased`}
|
|
>
|
|
<head>
|
|
<script
|
|
dangerouslySetInnerHTML={{ __html: ADMIN_LOCALE_BOOTSTRAP }}
|
|
/>
|
|
</head>
|
|
<body className="flex min-h-full flex-col">
|
|
<Providers>{children}</Providers>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|