'use client' import { useState } from 'react' import Link from 'next/link' import { ArrowLeft, Gift, Mail, Key, CheckCircle, AlertCircle, Loader2 } from 'lucide-react' export default function RedeemPage() { const [email, setEmail] = useState('') const [code, setCode] = useState('') const [isLoading, setIsLoading] = useState(false) const [isRedeemed, setIsRedeemed] = useState(false) const [error, setError] = useState(null) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError(null) if (!email.trim()) { setError('Please enter your email address') return } if (!code.trim()) { setError('Please enter your redemption code') return } // Basic email validation const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ if (!emailRegex.test(email.trim())) { setError('Please enter a valid email address') return } setIsLoading(true) // TODO: Wire up to backend // For now, just simulate a delay and show success await new Promise(resolve => setTimeout(resolve, 1500)) setIsLoading(false) setIsRedeemed(true) } // Success state if (isRedeemed) { return (

Code Redeemed!

Your premium access has been activated for

{email}

Enjoy all premium question packs and features.

Back to Home
) } return (
{/* Header */}
Back to Home
{/* Content */}
{/* Icon */}
{/* Title */}

Redeem Premium

Enter your email and redemption code to unlock premium features

{/* Form */}
{/* Error Message */} {error && (

{error}

)} {/* Email Field */}
{ setError(null); setEmail(e.target.value) }} placeholder="Enter your email" className="w-full bg-white/5 border border-white/10 rounded-lg py-3 pl-12 pr-4 text-white placeholder:text-white/30 focus:outline-none focus:border-primary/50 transition-colors" />
{/* Code Field */}
{ setError(null); setCode(e.target.value.toUpperCase()) }} placeholder="Enter redemption code" className="w-full bg-white/5 border border-white/10 rounded-lg py-3 pl-12 pr-4 text-white placeholder:text-white/30 focus:outline-none focus:border-primary/50 transition-colors uppercase tracking-wider" />
{/* Submit Button */}
{/* Info Text */}

Redemption codes are provided through promotions and giveaways. Each code can only be used once.

{/* Footer */}
) }