"use client"; import { Color, GameStatus as GameStatusType, Move } from "../types/chess"; interface GameStatusProps { status: GameStatusType; turn: Color; winner?: Color; moveHistory: Move[]; onCloseModal?: () => void; } export default function GameStatus({ status, turn, winner, moveHistory, onCloseModal, }: GameStatusProps) { const getStatusMessage = () => { switch (status) { case "playing": return `${turn === "red" ? "红方" : "黑方"}走棋`; case "check": return `${turn === "red" ? "红方" : "黑方"}被将军!`; case "checkmate": return `${winner === "red" ? "红方" : "黑方"}获胜!`; case "stalemate": case "draw": return "和棋"; default: return ""; } }; const getStatusColor = () => { switch (status) { case "playing": return "#2563eb"; case "check": return "#dc2626"; case "checkmate": return "#16a34a"; case "stalemate": case "draw": return "#6b7280"; default: return "#2563eb"; } }; // 只显示最近10步 const recentMoves = moveHistory.slice(-10); return ( <> {/* 状态显示 */}