import { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { useAuth } from '@/contexts/AuthContext'; import { useLanguage } from '@/contexts/LanguageContext'; import { Apple, Eye, EyeOff } from 'lucide-react'; import { FaGoogle } from 'react-icons/fa'; const SignUp = () => { const [formData, setFormData] = useState({ fullName: '', email: '', password: '', confirmPassword: '', userType: 'tourist' as 'tourist' | 'business' }); const [showPassword, setShowPassword] = useState(false); const [showConfirmPassword, setShowConfirmPassword] = useState(false); const [agreeToTerms, setAgreeToTerms] = useState(false); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const { register } = useAuth(); const { t } = useLanguage(); const navigate = useNavigate(); const handleChange = (e: React.ChangeEvent) => { setFormData({ ...formData, [e.target.name]: e.target.value }); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); if (formData.password !== formData.confirmPassword) { setError('Las contraseñas no coinciden'); return; } if (!agreeToTerms) { setError('Debes aceptar los términos de servicio'); return; } setIsLoading(true); try { await register({ name: formData.fullName, email: formData.email, password: formData.password, type: formData.userType, location: { lat: 18.4861, lng: -69.9312 }, // Default to Santo Domingo preferences: { language: 'es' } }); navigate('/dashboard'); } catch (err: any) { setError(err.message); } finally { setIsLoading(false); } }; const handleSocialLogin = (provider: string) => { console.log(`Register with ${provider}`); }; return (
{/* Left Side - Form */}
{/* Header */}

{t('welcomeSignUp')} {t('signUp')} {t('toContinue')}

{t('unlockContent')}

{/* Social Login Buttons */}

{t('privacyNotice')}

{/* Divider */}
Or
{/* Registration Form */}
{error && (
{error}
)}
setAgreeToTerms(e.target.checked)} className="w-4 h-4 text-primary border-gray-300 rounded focus:ring-primary mt-1" />

Already have an account?{' '} {t('signIn')}

{/* Right Side - Image & Content */}

Effortlessly organize your workspace with ease.

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.

698x609
); }; export default SignUp;