This repository has been archived on 2025-07-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
eternos/frontend/style/app/login/page.tsx
2025-02-15 17:41:30 +03:00

49 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client"
import { useState } from "react"
import { useRouter } from "next/navigation"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { useAuth } from "@/contexts/auth-context"
export default function LoginPage() {
const [email, setEmail] = useState("")
const [password, setPassword] = useState("")
const router = useRouter()
const { login } = useAuth()
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
// In a real application, you would validate credentials here
login()
router.push("/")
}
return (
<div className="container mx-auto px-4 py-8">
<h1 className="text-2xl font-bold mb-6">Войти</h1>
<form onSubmit={handleSubmit} className="space-y-4 max-w-md mx-auto">
<div>
<Label htmlFor="email">Email</Label>
<Input type="email" id="email" value={email} onChange={(e) => setEmail(e.target.value)} required />
</div>
<div>
<Label htmlFor="password">Пароль</Label>
<Input
type="password"
id="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
required
/>
</div>
<Button type="submit" className="w-full">
Войти
</Button>
</form>
</div>
)
}