mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
d4b051d92a
Update next versions of internal apps The `Deploy docs to Vercel` job is also broken at head Fixes: VULN-7922 Fixes: VULN-7923
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import type { Metadata } from 'next'
|
|
import type React from 'react'
|
|
import './globals.css'
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'Next.js Bundle Analyzer',
|
|
description:
|
|
'Visualize and analyze your Next.js bundle sizes with interactive treemap and dependency analysis',
|
|
}
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode
|
|
}>) {
|
|
return (
|
|
<html
|
|
lang="en"
|
|
// Suppress hydration warnings here specifically because we'll modify the
|
|
// classname for the theme before React hydates. This is to prevent a flash
|
|
// of incorrect theme.
|
|
suppressHydrationWarning
|
|
>
|
|
<head>
|
|
<script
|
|
// biome-ignore lint/security/noDangerouslySetInnerHtml: Needed to prevent flash of incorrect theme
|
|
dangerouslySetInnerHTML={{
|
|
__html: `
|
|
(function() {
|
|
const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
document.documentElement.classList.toggle('dark', theme === 'dark');
|
|
|
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
|
document.documentElement.classList.toggle('dark', e.matches);
|
|
});
|
|
})();
|
|
`,
|
|
}}
|
|
/>
|
|
</head>
|
|
<body className="font-sans antialiased">{children}</body>
|
|
</html>
|
|
)
|
|
}
|