import React, { useMemo } from 'react'; import { useTheme } from '../contexts/ThemeContext'; import { Theme } from '../types'; interface Props { onStartGame: () => void; categories?: string[]; selectedCategory?: string; onSelectCategory?: (cat: string) => void; } const MainMenu: React.FC = ({ onStartGame, categories = [], selectedCategory = 'random', onSelectCategory }) => { const { theme, toggleTheme } = useTheme(); const modes = useMemo(() => ['random', ...categories], [categories]); const currentIndex = Math.max(0, modes.findIndex(m => (selectedCategory || 'random') === m)); const currentMode = modes[currentIndex] || 'random'; const nextMode = modes[(currentIndex + 1) % modes.length] || 'random'; return (

TyperPunk

); }; export default MainMenu;