'use client';

import { useEffect } from 'react';
import { useSearchParams } from 'next/navigation';

import { buildAuthPortalUrl } from '@/lib/auth-portal';

export default function RegisterRedirectPage() {
  const searchParams = useSearchParams();

  useEffect(() => {
    const nextPath = searchParams?.get('next') || '/mcp';
    window.location.replace(buildAuthPortalUrl('/register', nextPath));
  }, [searchParams]);

  return (
    <div className="flex min-h-screen items-center justify-center px-4">
      <div className="text-sm text-muted-foreground">正在跳转到注册门户...</div>
    </div>
  );
}
