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
{isLogin ? 'Login to comment, react, and access admin features' : 'Join our community of sarcastic news enthusiasts'}
By {isLogin ? 'logging in' : 'registering'}, you agree to our{' '} Terms of Service{' '} and{' '} Privacy Policy.
Need help?{' '} Contact support