import React from 'react'; import Image from 'next/image'; import TimerDisplay from './TimerDisplay'; import { MoleDirection } from '@/lib/api'; interface GameStatusProps { // Timer props gameTreeId: number | null; sessionId: number | null; onTimerExpire: () => Promise; // Score props score: number; molesKilled: number; // Direction indicator props moleDirection: MoleDirection | null; } const GameStatus: React.FC = ({ gameTreeId, sessionId, onTimerExpire, score, molesKilled, moleDirection, }) => { // Get position for mole direction indicator const getMoleIndicatorPosition = (direction: string) => { const positions: Record = { 'up': 'top-1/2 left-1/2 -translate-x-1/2 -translate-y-full -mt-8', 'down': 'bottom-20 left-1/2 -translate-x-1/2', 'left': 'top-1/2 left-8 -translate-y-1/2', 'right': 'top-1/2 right-8 -translate-y-1/2', 'up-left': 'top-20 left-8', 'up-right': 'top-20 right-8', 'down-left': 'bottom-20 left-8', 'down-right': 'bottom-20 right-8', }; return positions[direction] || positions['up']; }; // Get rotation for arrow based on angle const getArrowRotation = (angle: number) => { return `rotate(${angle}deg)`; }; return ( <> {/* Mole Direction Indicator */} {moleDirection && (
Mole
)} {/* Score and Timer Display - Top Right */}
{/* Timer */} {/* Score */} {molesKilled > 0 && (
Score: {score}
Moles: {molesKilled}
)}
{/* Custom styles for animations */} ); }; export default GameStatus;