import { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { Mail, Lock, Eye, EyeOff, User } from 'lucide-react'; import { Input } from '../components/ui/Input'; import { GradientButton } from '../components/ui/GradientButton'; import { Button } from '../components/ui/Button'; import { useAuth } from '../context/AuthContext'; export function SignUpPage() { const navigate = useNavigate(); const { signup } = useAuth(); const [fullName, setFullName] = useState(''); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [confirmPassword, setConfirmPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const [error, setError] = useState(''); const [isLoading, setIsLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (password !== confirmPassword) { setError('Passwords do not match'); return; } setError(''); setIsLoading(true); try { await signup({ fullName, email, password }); navigate('/profile/create'); } catch (err) { setError(err instanceof Error ? err.message : 'Sign up failed'); } finally { setIsLoading(false); } }; return (
Create your account to start buying and selling
Already have an account?{' '} Login >