'use client';

import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { usePlanFeatures } from '@client/contexts/PlanFeaturesContext';

export default function BulkUploadRedirectPage() {
  const router = useRouter();
  const { hasFeature, loading } = usePlanFeatures();

  useEffect(() => {
    if (loading) return;
    if (!hasFeature('bulk_upload')) {
      router.replace('/billing?reason=feature_not_included');
    } else {
      router.replace('/menu-management');
    }
  }, [router, hasFeature, loading]);
  return null;
}
