"use client" import React, { useState } from "react" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" import { useAuth } from "@/lib/auth-context" import { Mail, Lock, LogIn, AlertCircle } from "lucide-react" interface LoginFormProps { onSwitchToRegister: () => void } export function LoginForm({ onSwitchToRegister }: LoginFormProps) { const { login } = useAuth() const [email, setEmail] = useState("") const [password, setPassword] = useState("") const [error, setError] = useState("") const [isLoading, setIsLoading] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError("") setIsLoading(true) const success = await login(email, password) if (!success) { setError("Ungültige E-Mail oder Passwort") } setIsLoading(false) } return ( Willkommen zurück Bitte melden Sie sich an
{error && (
{error}
)}
setEmail(e.target.value)} className="pl-10" required />
setPassword(e.target.value)} className="pl-10" required />

Hinweis:

Nutzen Sie Ihre registrierten Zugangsdaten.

{"Noch kein Konto? "}

) }