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 (
You need an account to {feature}. It's free and only takes a minute!
You can still play all games as a guest - no worries!