import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { authApi } from '../api/client'; import { Loader2, Wallet } from 'lucide-react'; import { FcGoogle } from 'react-icons/fc'; export default function Login() { const { t } = useTranslation(); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const handleGoogleLogin = async () => { try { setLoading(true); setError(''); const currentUrl = window.location.origin; const response = await authApi.getGoogleAuthUrl(currentUrl); window.location.href = response.data.url; } catch (err) { setError(t('login.authError')); console.error(err); setLoading(false); } }; return (

{t('login.title')}

{t('login.subtitle')}

{error && (
{error}
)}
); }