'use client';

import { useEffect } from 'react';
import { useAuth } from '@/contexts/AuthContext';
import { useRouter } from 'next/navigation';
import ForumMaintenanceTool from '@/components/admin/ForumMaintenanceTool';

export default function ForumMaintenancePage() {
  const { user, loading } = useAuth();
  const router = useRouter();

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

  if (loading || !user) return null;

  return <ForumMaintenanceTool />;
}
