mc-dashboard/app/layout.tsx
hurkicorgi 6c91f7fef0 UX/UI/perf pass: admin tabs, theme toggle, log polish, mod search, JAR cache
- Admin page split into tabs (Server/Players/Chat/Mods/Backups/Logs) with
  hash + localStorage persistence; inactive tabs no longer mount.
- Log viewer: level color-coding, search, level filter chips, auto-scroll
  toggle, copy button, visible-line count.
- Installed mods list: search field + side filter (all/both/server/client)
  with live count; public ModList gets skeleton + empty states and search.
- Theme toggle with no-flash inline init, localStorage + system preference.
- Layout: full OG / Twitter metadata, title template, keywords,
  dual-theme themeColor, metadataBase.
- lib/mods.ts: per-jar mtime+size parse cache (cold 6s -> warm ~45ms on
  /api/mods for the full mod list); cache eviction on mod removal.
- ChatBridge polling eased 3s -> 5s with 2s stale window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 04:58:25 -06:00

101 lines
2.6 KiB
TypeScript

import type { Metadata, Viewport } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { Providers } from "./providers";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
const SITE_URL = "https://minecraft.hurkicorgi.com";
const SITE_TITLE = "HurkiCorgi MC";
const SITE_DESCRIPTION =
"Modded Minecraft Forge 1.20.1 server — Create & Engineering, Raids, Survival. Live status, mod list, and installer.";
export const metadata: Metadata = {
metadataBase: new URL(SITE_URL),
title: {
default: SITE_TITLE,
template: `%s · ${SITE_TITLE}`,
},
description: SITE_DESCRIPTION,
manifest: "/manifest.json",
applicationName: SITE_TITLE,
keywords: ["Minecraft", "Forge", "Create mod", "modded server", "HurkiCorgi"],
appleWebApp: {
capable: true,
statusBarStyle: "black-translucent",
title: SITE_TITLE,
},
icons: {
icon: "/icon.svg",
apple: "/icon.svg",
},
openGraph: {
type: "website",
url: SITE_URL,
title: SITE_TITLE,
description: SITE_DESCRIPTION,
siteName: SITE_TITLE,
images: [{ url: "/icon.svg", width: 512, height: 512, alt: SITE_TITLE }],
},
twitter: {
card: "summary",
title: SITE_TITLE,
description: SITE_DESCRIPTION,
images: ["/icon.svg"],
},
robots: { index: true, follow: true },
};
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
maximumScale: 1,
themeColor: [
{ media: "(prefers-color-scheme: dark)", color: "#1a1a2e" },
{ media: "(prefers-color-scheme: light)", color: "#f8fafc" },
],
};
const themeInit = `
try {
var s = localStorage.getItem('theme');
var m = window.matchMedia('(prefers-color-scheme: light)').matches;
var t = s || (m ? 'light' : 'dark');
var h = document.documentElement;
h.classList.add(t);
h.style.colorScheme = t;
} catch (e) { document.documentElement.classList.add('dark'); }
`;
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html
lang="en"
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
suppressHydrationWarning
>
<head>
<script dangerouslySetInnerHTML={{ __html: themeInit }} />
</head>
<body className="min-h-full flex flex-col overflow-x-hidden">
<Providers>
<div className="flex flex-col flex-1 w-full overflow-x-hidden">
{children}
</div>
</Providers>
</body>
</html>
);
}