layout.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import clsx from 'clsx';
  2. import {Inter} from 'next/font/google';
  3. import { NextIntlClientProvider } from 'next-intl';
  4. import { getLocale, getMessages } from 'next-intl/server';
  5. import {Providers} from "./providers";
  6. import { getSrcPath } from '@/lib/path';
  7. import type { Metadata } from 'next';
  8. import "@/styles/globals.css";
  9. // export const dynamic = 'error'
  10. const inter = Inter({subsets: ['latin']});
  11. export const metadata: Metadata = {
  12. title: 'ai数字人',
  13. icons: '/favicon.ico',
  14. };
  15. export default async function RootLayout({
  16. children,
  17. }: Readonly<{
  18. children: React.ReactNode;
  19. }>) {
  20. const locale = await getLocale();
  21. const messages = await getMessages();
  22. return (
  23. <html lang={locale} className='dark h-full'>
  24. <head>
  25. <script src={getSrcPath('sentio/core/live2dcubismcore.min.js')} />
  26. </head>
  27. <body className={clsx(inter.className, 'h-full')}>
  28. <NextIntlClientProvider messages={messages}>
  29. <Providers>
  30. <main className='h-full'>
  31. {children}
  32. </main>
  33. </Providers>
  34. </NextIntlClientProvider>
  35. </body>
  36. </html>
  37. );
  38. }