import React, { useState } from 'react'; import { useNavigate, Link } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; import { Box, Typography, Container, IconButton, CircularProgress, Fade } from '@mui/material'; import { Email as EmailIcon, Lock as LockIcon, Visibility, VisibilityOff, ArrowForward, Person as PersonIcon, Diamond as DiamondIcon } from '@mui/icons-material'; const Register = () => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const { register } = useAuth(); const navigate = useNavigate(); const handleSubmit = async (e) => { e.preventDefault(); setError(''); setLoading(true); try { await register(email, password); navigate('/dashboard'); } catch (err) { setError('Registration failed. Try a different email.'); } finally { setLoading(false); } }; return ( {/* Animated Background */}
{/* Header */} MEXAR Ultimate Create your reasoning agents today {/* Form */}
{/* Email Input */} EMAIL ADDRESS setEmail(e.target.value)} required /> {/* Password Input */} PASSWORD setPassword(e.target.value)} required /> setShowPassword(!showPassword)} sx={{ position: 'absolute', right: 8, top: 8, color: 'text.secondary' }} size="small" > {showPassword ? : } {/* Error Message */} {error && ( ⚠️ {error} )} {/* Submit Button */}
{/* Footer */} Already have an account? {' '} Sign In
); }; export default Register;