"use client" import { useState } from "react" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group" import { Label } from "@/components/ui/label" import { Input } from "@/components/ui/input" import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@/components/ui/dialog" import { Cpu, Monitor, Zap, DollarSign, ArrowRight, ArrowLeft, HelpCircle, Lightbulb, CheckCircle2, } from "lucide-react" import { type PerformanceCategory } from "@/lib/mock-data" interface BuildWizardProps { isOpen: boolean onComplete: (data: { priorityComponent: "gpu" | "cpu" | "none" budget: number performanceCategory: PerformanceCategory experienceLevel: "beginner" | "intermediate" | "advanced" }) => void onSkip: () => void } export function BuildWizard({ isOpen, onComplete, onSkip }: BuildWizardProps) { const [step, setStep] = useState(1) const [priorityComponent, setPriorityComponent] = useState<"gpu" | "cpu" | "none">("none") const [budget, setBudget] = useState("") const [performanceCategory, setPerformanceCategory] = useState("all") const [experienceLevel, setExperienceLevel] = useState<"beginner" | "intermediate" | "advanced">("beginner") const totalSteps = 4 const handleNext = () => { if (step < totalSteps) { setStep(step + 1) } else { handleComplete() } } const handleBack = () => { if (step > 1) { setStep(step - 1) } } const handleComplete = () => { onComplete({ priorityComponent, budget: Number.parseInt(budget) || 0, performanceCategory, experienceLevel, }) } const handleSkip = () => { onSkip() } if (!isOpen) return null return ( {}}> {step === 1 && "Welcome to BuildMate! 🎉"} {step === 2 && "What's Your Priority?"} {step === 3 && "What's Your Budget?"} {step === 4 && "Tell Us About Yourself"} {step === 1 && "Let's guide you through building your perfect PC step by step."} {step === 2 && "Choose which component is most important for your build."} {step === 3 && "Set your budget to get personalized recommendations."} {step === 4 && "Help us customize your experience."}
{/* Progress Indicator */}
{Array.from({ length: totalSteps }).map((_, i) => (
))}

Step {step} of {totalSteps}

{/* Step 1: Welcome */} {step === 1 && (
How This Works

Step-by-Step Guidance

We'll guide you through selecting each component with clear instructions.

Automatic Compatibility

Incompatible components are automatically filtered out to prevent mistakes.

Smart Recommendations

Get personalized suggestions based on your needs and budget.

)} {/* Step 2: Priority Component */} {step === 2 && (

Starting with a priority component helps us recommend compatible parts. You can always change this later.

setPriorityComponent(value as "gpu" | "cpu" | "none")} className="space-y-3" >
)} {/* Step 3: Budget */} {step === 3 && (

Setting a budget helps us recommend components that fit your price range. You can skip this if you prefer.

setBudget(e.target.value)} className="text-lg" aria-label="Budget in PHP" />

Leave empty if you don't have a specific budget

setPerformanceCategory(value as PerformanceCategory)} className="space-y-2" >
)} {/* Step 4: Experience Level */} {step === 4 && (

Help us customize the guidance level for your experience.

setExperienceLevel(value as "beginner" | "intermediate" | "advanced")} className="space-y-3" >
)}
{/* Navigation Buttons */}
{step > 1 && ( )}
) }