diff --git a/src/app/_components/AuthModal.tsx b/src/app/_components/AuthModal.tsx index 8ac0aa9..32a60fa 100644 --- a/src/app/_components/AuthModal.tsx +++ b/src/app/_components/AuthModal.tsx @@ -1,23 +1,27 @@ -'use client'; +"use client"; -import { useState } from 'react'; -import { Button } from './ui/button'; -import { Input } from './ui/input'; -import { useAuth } from './AuthProvider'; -import { Lock, User, AlertCircle } from 'lucide-react'; -import { useRegisterModal } from './modal/ModalStackProvider'; -import { useTranslation } from '@/lib/i18n/useTranslation'; +import { useState } from "react"; +import { Button } from "./ui/button"; +import { Input } from "./ui/input"; +import { useAuth } from "./AuthProvider"; +import { Lock, User, AlertCircle } from "lucide-react"; +import { useRegisterModal } from "./modal/ModalStackProvider"; +import { useTranslation } from "@/lib/i18n/useTranslation"; interface AuthModalProps { isOpen: boolean; } export function AuthModal({ isOpen }: AuthModalProps) { - const { t } = useTranslation('authModal'); - useRegisterModal(isOpen, { id: 'auth-modal', allowEscape: false, onClose: () => null }); + const { t } = useTranslation("authModal"); + useRegisterModal(isOpen, { + id: "auth-modal", + allowEscape: false, + onClose: () => null, + }); const { login } = useAuth(); - const [username, setUsername] = useState(''); - const [password, setPassword] = useState(''); + const [username, setUsername] = useState(""); + const [password, setPassword] = useState(""); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); @@ -27,44 +31,49 @@ export function AuthModal({ isOpen }: AuthModalProps) { setError(null); const success = await login(username, password); - + if (!success) { - setError(t('error')); + setError(t("error")); } - + setIsLoading(false); }; if (!isOpen) return null; return ( -
-
+
+
{/* Header */} -
+
- -

{t('title')}

+ +

+ {t("title")} +

{/* Content */}
-

- {t('description')} +

+ {t("description")}

-