import React, { useState } from 'react' import { Link, useNavigate } from 'react-router-dom' import { useAuthStore } from '../store/authStore' import { Map, Eye, EyeOff, Mail, Lock, User } from 'lucide-react' export default function RegisterPage() { 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('Passwörter stimmen nicht überein') return } if (password.length < 6) { setError('Passwort muss mindestens 6 Zeichen lang sein') return } setIsLoading(true) try { await register(username, email, password) navigate('/dashboard') } catch (err) { setError(err.message || 'Registrierung fehlgeschlagen') } finally { setIsLoading(false) } } return (
Erstellen Sie ein Konto und beginnen Sie, Ihre Traumreisen zu planen.
{item}
))}Beginnen Sie Ihre Reiseplanung
Bereits ein Konto?{' '} Anmelden