import { useNavigate } from 'react-router-dom'; import useFocusTrap from '../hooks/useFocusTrap'; import './UpgradePrompt.css'; export default function UpgradePrompt({ onClose, feature = 'this feature' }) { const navigate = useNavigate(); // Focus trap with escape key handling and auto-focus const modalRef = useFocusTrap(true, { onEscape: onClose, autoFocus: true, restoreFocus: true }); const handleCreateAccount = () => { onClose(); navigate('/register'); }; const benefits = [ { icon: '💾', title: 'Save Your Progress', description: 'Keep track of your high scores and achievements' }, { icon: '🎮', title: 'Create Games', description: 'Design your own games with our easy wizard' }, { icon: '🏆', title: 'Earn Achievements', description: 'Unlock cool badges as you play and create' }, { icon: '👥', title: 'Follow Creators', description: 'Get notified when your favorite creators make new games' } ]; return (
e.stopPropagation()}>

Create Your Free Account!

You need an account to {feature}. It's free and only takes a minute!

With a free account, you can:

    {benefits.map((benefit, index) => (
  • {benefit.icon}
    {benefit.title} {benefit.description}
  • ))}

You can still play all games as a guest - no worries!

); }