From 62c08e7132a9252bf6ca1b0b2f4a8ad0bb534952 Mon Sep 17 00:00:00 2001 From: zch1234qq Date: Sat, 18 Oct 2025 05:08:53 +0000 Subject: [PATCH] qwe --- Dockerfile | 3 +++ app/components/Message.tsx | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9776002..dd16fa9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,9 @@ RUN npm install # 复制项目文件 COPY . . +# 构建项目 +RUN npm run build + # 生产阶段 - 使用Node镜像运行Next.js应用 FROM node:20-alpine diff --git a/app/components/Message.tsx b/app/components/Message.tsx index dfc183a..68b35a0 100644 --- a/app/components/Message.tsx +++ b/app/components/Message.tsx @@ -1,5 +1,6 @@ -import React, { useRef } from 'react'; -import { Box, Paper, Typography, Avatar, useMediaQuery, useTheme } from '@mui/material'; +import * as React from 'react'; +const { useRef } = React; +import { Box, Paper, Typography, Avatar, useMediaQuery, useTheme, Theme } from '@mui/material'; import ReactMarkdown from 'react-markdown'; import rehypeRaw from 'rehype-raw'; import remarkGfm from 'remark-gfm'; @@ -85,39 +86,38 @@ const Message: React.FC = ({ message, isLast = false }) => { remarkPlugins={[remarkGfm]} components={{ // 自定义标题样式 - h1: (props: any) => ( + h1: (props: React.ComponentProps<'h1'>) => (

), - h2: (props: any) => ( + h2: (props: React.ComponentProps<'h2'>) => (

), - h3: (props: any) => ( + h3: (props: React.ComponentProps<'h3'>) => (

), // 自定义列表样式 - ul: (props: any) => ( + ul: (props: React.ComponentProps<'ul'>) => (
    ), - ol: (props: any) => ( + ol: (props: React.ComponentProps<'ol'>) => (
      ), - li: (props: any) => ( + li: (props: React.ComponentProps<'li'>) => (
    1. ), // 自定义代码块样式 - // 简化代码块处理,移除对 node 对象内部属性的访问 - code: (props: any) => ( + code: (props: React.ComponentProps<'code'>) => ( ), - pre: (props: any) => ( + pre: (props: React.ComponentProps<'pre'>) => (
                         ),
                         // 自定义引用样式
      -                  blockquote: (props: any) => (
      +                  blockquote: (props: React.ComponentProps<'blockquote'>) => (
                           
      ), // 自定义链接样式 - a: (props: any) => ( + a: (props: React.ComponentProps<'a'>) => ( ) }}