Files
blog/write-server/src/app/layout.tsx
T
2026-06-22 14:59:24 +08:00

34 lines
794 B
TypeScript

import type { Metadata } from "next";
import "./globals.css";
import AppShell from "@/components/AppShell";
export const metadata: Metadata = {
title: "写作后台",
description: "Blog admin for Hugo",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const themeScript = `
try {
if (localStorage.getItem("write-theme") === "dark") {
document.documentElement.dataset.theme = "dark";
}
} catch {}
`;
return (
<html lang="zh-CN" className="h-full" suppressHydrationWarning>
<head>
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
</head>
<body className="h-full md:flex bg-bg text-text">
<AppShell>{children}</AppShell>
</body>
</html>
);
}