import React, { useState } from 'react' import { Link, useNavigate } from 'react-router-dom' import { useAuthStore } from '../store/authStore' import { useTranslation } from '../i18n' import { Map, Eye, EyeOff, Mail, Lock, User } from 'lucide-react' export default function RegisterPage() { const { t } = useTranslation() const [username, setUsername] = useState('') const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [confirmPassword, setConfirmPassword] = useState('') const [showPassword, setShowPassword] = useState(false) const [isLoading, setIsLoading] = useState(false) const [error, setError] = useState('') const { register } = useAuthStore() const navigate = useNavigate() const handleSubmit = async (e) => { e.preventDefault() setError('') if (password !== confirmPassword) { setError(t('register.passwordMismatch')) return } if (password.length < 6) { setError(t('register.passwordTooShort')) return } setIsLoading(true) try { await register(username, email, password) navigate('/dashboard') } catch (err) { setError(err.message || t('register.failed')) } finally { setIsLoading(false) } } return (
{/* Left panel */}

{t('register.getStarted')}

{t('register.subtitle')}

{[ `✓ ${t('register.feature1')}`, `✓ ${t('register.feature2')}`, `✓ ${t('register.feature3')}`, `✓ ${t('register.feature4')}`, `✓ ${t('register.feature5')}`, `✓ ${t('register.feature6')}`, ].map(item => (

{item}

))}
{/* Right panel */}
NOMAD

{t('register.createAccount')}

{t('register.startPlanning')}

{error && (
{error}
)}
setUsername(e.target.value)} required placeholder="johndoe" minLength={3} className="w-full pl-10 pr-4 py-2.5 border border-slate-300 rounded-lg text-slate-900 placeholder-slate-400 focus:ring-2 focus:ring-slate-400 focus:border-transparent transition-all" />
setEmail(e.target.value)} required placeholder="your@email.com" className="w-full pl-10 pr-4 py-2.5 border border-slate-300 rounded-lg text-slate-900 placeholder-slate-400 focus:ring-2 focus:ring-slate-400 focus:border-transparent transition-all" />
setPassword(e.target.value)} required placeholder={t('register.minChars')} className="w-full pl-10 pr-12 py-2.5 border border-slate-300 rounded-lg text-slate-900 placeholder-slate-400 focus:ring-2 focus:ring-slate-400 focus:border-transparent transition-all" />
setConfirmPassword(e.target.value)} required placeholder={t('register.repeatPassword')} className="w-full pl-10 pr-4 py-2.5 border border-slate-300 rounded-lg text-slate-900 placeholder-slate-400 focus:ring-2 focus:ring-slate-400 focus:border-transparent transition-all" />

{t('register.hasAccount')}{' '} {t('register.signIn')}

) }