import { useState } from 'react'; import { LoginForm } from '../auth/LoginForm'; import { RegisterForm } from '../auth/RegisterForm'; import { useAuth } from '../../contexts/AuthContext'; import { Navigate } from '@tanstack/react-router'; export function AuthPage() { const { isAuthenticated } = useAuth(); const [isLogin, setIsLogin] = useState(true); if (isAuthenticated) { return ; } return (

Welcome to Placebo.mk

{isLogin ? 'Login to comment, react, and access admin features' : 'Join our community of sarcastic news enthusiasts'}

{isLogin ? ( window.location.href = '/'} onSwitchToRegister={() => setIsLogin(false)} /> ) : ( window.location.href = '/'} onSwitchToLogin={() => setIsLogin(true)} /> )}

By {isLogin ? 'logging in' : 'registering'}, you agree to our{' '} Terms of Service{' '} and{' '} Privacy Policy.

Need help?{' '} Contact support

); }