layout.tsx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import type { Metadata } from "next";
  2. import { Geist, Geist_Mono } from "next/font/google";
  3. import "./globals.css";
  4. import MatomoTracker from "@/components/MatomoTracker";
  5. const geistSans = Geist({
  6. variable: "--font-geist-sans",
  7. subsets: ["latin"],
  8. });
  9. const geistMono = Geist_Mono({
  10. variable: "--font-geist-mono",
  11. subsets: ["latin"],
  12. });
  13. export const metadata: Metadata = {
  14. title: "AI-CS 智能客服系统",
  15. description: "融合 AI 技术与人工客服,为企业提供高效、智能的客户服务解决方案",
  16. };
  17. // Matomo 容器 URL(格式:container_*.js)
  18. const MATOMO_CONTAINER_URL = process.env.NEXT_PUBLIC_MATOMO_CONTAINER_URL || '';
  19. export default function RootLayout({
  20. children,
  21. }: Readonly<{
  22. children: React.ReactNode;
  23. }>) {
  24. return (
  25. <html lang="en">
  26. <body
  27. className={`${geistSans.variable} ${geistMono.variable} antialiased`}
  28. >
  29. {children}
  30. {MATOMO_CONTAINER_URL && <MatomoTracker containerUrl={MATOMO_CONTAINER_URL} />}
  31. </body>
  32. </html>
  33. );
  34. }