import React, { useState } from 'react'; import { FiMail, FiLock } from 'react-icons/fi'; import { authAPI } from '../services/api'; const Login = ({ onLogin }) => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [busy, setBusy] = useState(false); const submit = async (e) => { e.preventDefault(); setBusy(true); setError(''); try { const me = await authAPI.login(email.trim().toLowerCase(), password); onLogin(me); } catch (err) { setError(err.message); } finally { setBusy(false); } }; return (
Sign in to manage your mail server