layout.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* eslint-disable @next/next/no-page-custom-font */
  2. import "./styles/globals.scss";
  3. import "./styles/markdown.scss";
  4. import "./styles/highlight.scss";
  5. import { getClientConfig } from "./config/client";
  6. import { type Metadata } from "next";
  7. import { SpeedInsights } from "@vercel/speed-insights/next";
  8. import { getServerSideConfig } from "./config/server";
  9. const serverConfig = getServerSideConfig();
  10. export const metadata: Metadata = {
  11. title: "NextChat",
  12. description: "Your personal ChatGPT Chat Bot.",
  13. viewport: {
  14. width: "device-width",
  15. initialScale: 1,
  16. maximumScale: 1,
  17. },
  18. themeColor: [
  19. { media: "(prefers-color-scheme: light)", color: "#fafafa" },
  20. { media: "(prefers-color-scheme: dark)", color: "#151515" },
  21. ],
  22. appleWebApp: {
  23. title: "NextChat",
  24. statusBarStyle: "default",
  25. },
  26. };
  27. export default function RootLayout({
  28. children,
  29. }: {
  30. children: React.ReactNode;
  31. }) {
  32. return (
  33. <html lang="en">
  34. <head>
  35. <meta name="config" content={JSON.stringify(getClientConfig())} />
  36. <link rel="manifest" href="/site.webmanifest"></link>
  37. <script src="/serviceWorkerRegister.js" defer></script>
  38. </head>
  39. <body>
  40. {children}
  41. {serverConfig?.isVercel && (
  42. <>
  43. <SpeedInsights />
  44. </>
  45. )}
  46. </body>
  47. </html>
  48. );
  49. }