"use client"

import { useEffect } from "react"
import { useRouter } from "next/navigation"
import { authClient } from "@/lib/auth-client"

export default function ParentPage() {
  const { data: session, isPending } = authClient.useSession()
  const router = useRouter()

  useEffect(() => {
    if (isPending) return
    if (session) {
      router.replace("/parent/dashboard")
    } else {
      router.replace("/parent/auth/login")
    }
  }, [session, isPending, router])

  return null
}
