"use client" import { useState, useEffect } from "react" import { Cpu, Sparkles } from "lucide-react" import { Button } from "@/components/ui/button" import Link from "next/link" interface WelcomeScreenProps { onComplete: () => void } export function WelcomeScreen({ onComplete }: WelcomeScreenProps) { const [currentStep, setCurrentStep] = useState(0) const [isVisible, setIsVisible] = useState(true) const steps = [ { title: "Welcome to BuildMate", description: "Your ultimate PC building companion", icon: Cpu, delay: 0, }, { title: "Smart Compatibility Checking", description: "Advanced algorithms ensure your components work perfectly together", icon: Sparkles, delay: 2000, }, { title: "Expert Recommendations", description: "Get personalized suggestions based on your needs and budget", icon: Sparkles, delay: 4000, }, ] useEffect(() => { if (currentStep >= steps.length - 1) { // On last step, wait 2 seconds then fade out const fadeTimer = setTimeout(() => { setIsVisible(false) setTimeout(() => { onComplete() }, 500) }, 2000) return () => clearTimeout(fadeTimer) } else { // Auto-advance to next step after 2 seconds const timer = setTimeout(() => { setCurrentStep(currentStep + 1) }, 2000) return () => clearTimeout(timer) } }, [currentStep, onComplete, steps.length]) if (!isVisible) return null const currentStepData = steps[currentStep] const Icon = currentStepData?.icon || Cpu return (

{currentStepData?.title || "Welcome to BuildMate"}

{currentStepData?.description || "Your ultimate PC building companion"}

{steps.map((_, index) => (
))}
) }