refactor: migrate img tags to next/image and fix hook usage

This commit is contained in:
2026-06-10 19:16:41 +08:00
parent 47591be41c
commit 2bc2e1b691
30 changed files with 62 additions and 55 deletions
+3 -3
View File
@@ -20,8 +20,8 @@ import {
} from "react";
import { useMachine } from "@xstate/react";
import { chatMachine } from "./machine/chat-machine";
import type { ChatEvent, ChatState as MachineContext } from "./machine/chat-machine";
import { chatMachine } from "./chat-machine";
import type { ChatEvent, ChatState as MachineContext } from "./chat-machine";
/**
* 对外暴露的 State 形状(保持与原 ChatState 兼容)
@@ -46,7 +46,7 @@ export interface ChatProviderProps {
}
export function ChatProvider({ children }: ChatProviderProps) {
const [state, send] = useMachine(chatMachine);
const [state, send] = useMachine(chatMachine, {});
// 映射 XState 状态机快照 → 原 ChatState 形状
const chatState = useMemo<ChatState>(