Files
AI-CS/frontend/app/layout.tsx
T
2026-03-25 18:50:58 +08:00

53 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import MatomoTracker from "@/components/MatomoTracker";
import { Toaster } from "@/components/ui/toaster";
import { getSiteUrl } from "@/lib/site";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "AI-CS 智能客服系统",
description: "融合 AI 技术与人工客服,为企业提供高效、智能的客户服务解决方案",
};
// Matomo 容器 URL(格式:container_*.js
const MATOMO_CONTAINER_URL = process.env.NEXT_PUBLIC_MATOMO_CONTAINER_URL || '';
// 后端端口配置(用于 widget.js)
const BACKEND_PORT = process.env.NEXT_PUBLIC_BACKEND_PORT || '18080';
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="zh-CN">
<head>
<script
dangerouslySetInnerHTML={{
__html: `window.AICS_BACKEND_PORT = '${BACKEND_PORT}';`,
}}
/>
</head>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
<Toaster />
{MATOMO_CONTAINER_URL && <MatomoTracker containerUrl={MATOMO_CONTAINER_URL} />}
</body>
</html>
);
}