// import React from 'react'; import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration, isRouteErrorResponse, useRouteError, type MetaFunction } from "@remix-run/react"; import { Layout } from "~/components/layout/Layout"; import { ErrorBoundary as AppErrorBoundary } from "~/components/error/ErrorBoundary"; import "remixicon/fonts/remixicon.css"; // 不使用import导入样式 // 添加客户端hydration错误处理 // if (typeof window !== "undefined") { // window.addEventListener("error", (event) => { // if (event.message && event.message.includes("Hydration failed")) { // console.warn("Hydration error detected, refreshing page..."); // setTimeout(() => { // window.location.reload(); // }, 100); // event.preventDefault(); // } // }); // } export const meta: MetaFunction = () => { return [ { charSet: "utf-8" }, { name: "viewport", content: "width=device-width,initial-scale=1" }, { title: "中国烟草AI合同及卷宗审核系统" }, { name: "description", content: "专业的AI合同及卷宗评查系统,提供智能审核、风险评估和规范化建议" }, { name: "robots", content: "noindex,nofollow" } // 内部系统,防止被搜索引擎索引 ]; }; export function links() { return [ { rel: "stylesheet", href: "/tailwind.css" }, // 使用构建后的Tailwind CSS { rel: "preconnect", href: "https://fonts.googleapis.com" }, { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "anonymous" }, { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap" } ]; } export default function App() { return ( ); } export function ErrorBoundary() { const error = useRouteError(); if (isRouteErrorResponse(error)) { return ( 错误 {error.status} ); } return ( 意外错误 ); }