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
@@ -17,11 +17,11 @@ import {
} from "react";
import { useMachine } from "@xstate/react";
import { sidebarMachine } from "./machine/sidebar-machine";
import { sidebarMachine } from "./sidebar-machine";
import type {
SidebarState as MachineContext,
SidebarEvent,
} from "./machine/sidebar-machine";
} from "./sidebar-machine";
/**
* 对外暴露的 State 形状(保持与原 SidebarState 兼容)
@@ -37,7 +37,7 @@ const SidebarStateCtx = createContext<SidebarState | null>(null);
const SidebarDispatchCtx = createContext<Dispatch<SidebarEvent> | null>(null);
export function SidebarProvider({ children }: { children: ReactNode }) {
const [state, send] = useMachine(sidebarMachine);
const [state, send] = useMachine(sidebarMachine, {});
// 映射 XState 状态机快照 → 原 SidebarState 形状
const sidebarState = useMemo<SidebarState>(