import React from 'react';

/** 与 StaticPageConfig SMALL_GAMES 的 id 对齐 */
const GAME_EMOJI = {
  '2048': { emoji: '🔢', label: '2048' },
  'white-tile': { emoji: '🎹', label: '别踩白方块' },
  tetris: { emoji: '🧱', label: '俄罗斯方块' },
  snake: { emoji: '🐍', label: '贪吃蛇' },
  minesweeper: { emoji: '💣', label: '扫雷' },
  'dodge-leaves': { emoji: '🍃', label: '躲树叶' },
  plane: { emoji: '✈️', label: '打飞机' },
  parkour: { emoji: '🏃', label: '跑酷' },
  floppybird: { emoji: '🐦', label: 'Floppy Bird' },
  h5cube: { emoji: '🧩', label: '网页魔方' },
  sokoban: { emoji: '📦', label: '推箱子' },
};

export function SmallGameIcon({ gameId }) {
  const meta = GAME_EMOJI[gameId] || { emoji: '🎮', label: '小游戏' };
  return (
    <span
      role="img"
      aria-label={meta.label}
      className="inline-flex items-center justify-center text-[1.65rem] sm:text-[1.35rem] leading-none select-none"
    >
      {meta.emoji}
    </span>
  );
}

export default SmallGameIcon;
