refactor: migrate img tags to next/image and fix hook usage
This commit is contained in:
@@ -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>(
|
||||
|
||||
Reference in New Issue
Block a user