feat(admin): enhance login form with language switcher and update script handling

- Added AdminLanguageSwitcher to the login form for improved language selection.
- Replaced inline script with next/script component for better performance and safety in layout.tsx.
- Updated language initialization logic to ensure consistent SSR and client rendering.
This commit is contained in:
2026-05-26 09:57:05 +08:00
parent f080e6ba8e
commit fbe385666a
3 changed files with 11 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import Script from "next/script";
import { Providers } from "@/components/providers";
import "./globals.css";
@@ -37,7 +38,9 @@ export default function RootLayout({
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
>
<head>
<script dangerouslySetInnerHTML={{ __html: ADMIN_LOCALE_BOOTSTRAP }} />
<Script id="admin-locale-bootstrap" strategy="beforeInteractive">
{ADMIN_LOCALE_BOOTSTRAP}
</Script>
</head>
<body className="flex min-h-full flex-col">
<Providers>{children}</Providers>