import React, { useState, type FormEvent } from 'react'; import { TextInput, PasswordInput, Paper, Title, Container, Button, Text, Stack, } from '@mantine/core'; import { useAuth } from '../../contexts/AuthContext'; const LoginPage: React.FC = () => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [loading, setLoading] = useState(false); const { login } = useAuth(); const handleSubmit = (e: FormEvent): void => { e.preventDefault(); setLoading(true); login(email, password) .catch((error) => { console.error('Login failed:', error); }) .finally(() => { setLoading(false); }); }; return ( Welcome to Lemma Please sign in to continue
setEmail(event.currentTarget.value)} /> setPassword(event.currentTarget.value)} />
); }; export default LoginPage;