"use client"

import { redirect, useRouter } from "next/navigation"
import { useUser } from "../user-context"
import { useEffect } from "react"

export default function MePage() {
    const { isAuthenticated, isLoading, user } = useUser()
    const router = useRouter();

    useEffect(() => {
        if (!isLoading && !isAuthenticated) {
            router.push('/login');
        }
    }, [isAuthenticated, isLoading, router, user]);

    return (
        <div>
            <h1>Me</h1>
        </div>
    )
}