import React, { useState, useRef } from 'react'; import { ArrowRight, MessageCircle, Scan, Zap, Camera, Lightbulb, Sparkles, Upload, X } from 'lucide-react'; import { motion, AnimatePresence } from 'framer-motion'; import { useLanguage } from '@/contexts/LanguageContext'; interface HeroProps { onRegister: () => void; } const Hero: React.FC = ({ onRegister }) => { const [demoState, setDemoState] = useState<'initial' | 'analyzing' | 'result'>('initial'); const [userImage, setUserImage] = useState(null); const [showDemoInstruction, setShowDemoInstruction] = useState(false); const fileInputRef = useRef(null); const { t } = useLanguage(); const handleDemoClick = () => { setShowDemoInstruction(true); }; const handleTriggerUpload = () => { fileInputRef.current?.click(); }; const scrollToPricing = (e: React.MouseEvent) => { e.preventDefault(); const element = document.getElementById('pricing'); if (element) { element.scrollIntoView({ behavior: 'smooth' }); } }; const handleFileChange = (event: React.ChangeEvent) => { const file = event.target.files?.[0]; if (file) { const imageUrl = URL.createObjectURL(file); setUserImage(imageUrl); setShowDemoInstruction(false); // Fecha o modal setDemoState('analyzing'); // Simulate network delay and processing setTimeout(() => { setDemoState('result'); }, 3500); // Um pouco mais de tempo para ver o "robĂ´ pensando" } }; return (
{/* Hidden Input for Demo */} {/* Modern Background */}
{/* Text Content */}
NOVO: Coach AI 2.0 - Treino & Dieta

{t.hero.titleStart}
{t.hero.titleHighlight}

{t.hero.subtitle}

{[1, 2, 3].map((i) => (
user
))}
{t.hero.stats}
{t.hero.analysis}
{/* Visual Element - Modern Mockup Interactive */}
{/* Notch */}
{/* Screen */}
{/* Header Mockup */}

FoodSnap

Online

{/* Chat Area */}
{/* User Message (Image) */}
Meal

12:30

{/* Loading State / Robot Message */} {demoState === 'analyzing' && (
{t.hero.demoProcessing}
)} {/* AI Response */} {(demoState === 'initial' || demoState === 'result') && (
{/* Header Analysis */}
{t.hero.analysis}
Score A
{/* Macros */}
{demoState === 'initial' ? '485' : '520'} kcal {demoState === 'initial' ? 'High Protein' : 'Balanced'}

Prot

{demoState === 'initial' ? '32g' : '28g'}

Carb

{demoState === 'initial' ? '45g' : '55g'}

Gord

{demoState === 'initial' ? '12g' : '18g'}

{/* Insights */}

{t.hero.demoAdvice} {t.hero.demoAdviceText}

Powered by FoodSnap

)}
{/* Input Area (Visual Only) */}
...
{/* Floating Elements */} {demoState === 'initial' && (

Detected

Salmon Bowl

)}
{/* Demo Instruction Modal */} {showDemoInstruction && (
setShowDemoInstruction(false)} className="absolute inset-0 bg-gray-950/70 backdrop-blur-sm" />

{t.hero.demoModalTitle}

{t.hero.demoModalDesc}

)}
); }; export default Hero;