'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import { useTranslations, useLocale } from 'next-intl' import { Container, Paper, Box, Typography, Tabs, Tab, Link, Card, CardContent, Divider } from '@mui/material' import { MenuBook, Login as LoginIcon, PersonAdd } from '@mui/icons-material' import { LoginForm } from '@/components/auth/login-form' import { RegisterForm } from '@/components/auth/register-form' export default function AuthPage() { const [activeTab, setActiveTab] = useState(0) const router = useRouter() const locale = useLocale() const t = useTranslations('auth') const handleAuthSuccess = () => { router.push(`/${locale}`) } const handleTabChange = (event: React.SyntheticEvent, newValue: number) => { setActiveTab(newValue) } const getSubtitle = () => { if (locale === 'en') { return activeTab === 0 ? 'Sign in to continue exploring Scripture' : 'Create an account to begin your spiritual journey' } return activeTab === 0 ? 'Conectează-te pentru a continua explorarea Scripturii' : 'Creează un cont pentru a începe călătoria ta spirituală' } return ( {/* Header */} {activeTab === 0 ? t('welcomeBack') : t('joinUs')} {getSubtitle()} {/* Tabs */} } iconPosition="start" label={t('login')} /> } iconPosition="start" label={t('register')} /> {/* Forms */} {activeTab === 0 ? ( ) : ( )} {/* Switch Form Link */} {activeTab === 0 ? t('noAccount') : t('alreadyHaveAccount')}{' '} setActiveTab(activeTab === 0 ? 1 : 0)} sx={{ textDecoration: 'none', fontWeight: 600, '&:hover': { textDecoration: 'underline' } }} > {activeTab === 0 ? t('createAccount') : t('login')} ) }