"use client"

import { useEffect } from "react"
import { useRouter, useSearchParams } from "next/navigation"

export default function AuthPageRoute() {
  const router = useRouter()
  const searchParams = useSearchParams()

  useEffect(() => {
    // Check if user wants to sign up or sign in
    const mode = searchParams.get('mode')
    
    if (mode === 'signup') {
      router.replace('/signup')
    } else if (mode === 'signin') {
      router.replace('/signin')
    } else {
      // Default to signin page
      router.replace('/signin')
    }
  }, [router, searchParams])

  // Show loading while redirecting
  return (
    <div className="min-h-screen bg-black text-white flex items-center justify-center">
      <div className="text-center">
        <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-orange-500 mx-auto mb-4"></div>
        <p className="text-white/60">Redirecting...</p>
      </div>
    </div>
  )
}
