import { useState, useEffect } from 'react'; export default function OnboardingTour() { const [isOpen, setIsOpen] = useState(false); const [currentStep, setCurrentStep] = useState(0); const STEPS = [ { step: 1, title: "Visualize Instantly", description: "Upload your existing architecture diagrams or paste a text description to begin analysis. Our system automatically parses the input to generate editable nodes.", features: ["Supports PNG, JPG, PDF", "Natural Language Input"], icon: "cloud_upload", color: "primary", // blue-500 badges: [ { icon: "code", label: "Code", color: "text-emerald-400" }, { icon: "image", label: "PNG", color: "text-amber-400" } ] }, { step: 2, title: "Interactive Editing", description: "Double-click any node to edit its properties. Drag to reconnect, and use the intelligent layout engine to organize your system flow automatically.", features: ["Smart Auto-Layout", "Real-time Validation"], icon: "edit_square", color: "accent-purple", badges: [ { icon: "auto_fix_high", label: "Auto", color: "text-purple-400" } ] }, { step: 3, title: "Deep Dive Analysis", description: "Click on any component to see AI-generated insights, including technology stack recommendations, potential bottlenecks, and security considerations.", features: ["Tech Stack Inference", "Security Scanning"], icon: "analytics", color: "accent-teal", badges: [ { icon: "psychology", label: "AI", color: "text-teal-400" } ] }, { step: 4, title: "Export & Share", description: "Export your verified architecture as a PNG image, Mermaid code, or even a clean React component code to use directly in your documentation.", features: ["Mermaid / JSON", "React Component"], icon: "ios_share", color: "accent-blue", badges: [ { icon: "download", label: "Export", color: "text-blue-400" } ] } ]; useEffect(() => { const seen = localStorage.getItem('sysvis_onboarding_seen'); if (!seen) { const timer = setTimeout(() => setIsOpen(true), 1000); // Delay for effect return () => clearTimeout(timer); } }, []); const handleClose = () => { setIsOpen(false); localStorage.setItem('sysvis_onboarding_seen', 'true'); }; const handleNext = () => { if (currentStep < STEPS.length - 1) { setCurrentStep(prev => prev + 1); } else { handleClose(); } }; const handleBack = () => { if (currentStep > 0) { setCurrentStep(prev => prev - 1); } }; if (!isOpen) return null; const step = STEPS[currentStep]; return (
{/* Modal Card Container */}
{/* Left Side: Visual/Illustration Area */}
{/* Decorative Elements */}
{/* Main Illustration */}
{/* Ripple Effects with dynamic color */}
{/* Icon Circle */}
{step.icon}
{/* Floating Badges */} {step.badges.map((badge, idx) => (
{badge.icon} {badge.label}
))}
{/* Right Side: Content & Controls */}
{/* Header (Skip) */}
{/* Progress Indicators */}
{STEPS.map((_, idx) => (
setCurrentStep(idx)} className={`h-1.5 rounded-full transition-all duration-300 cursor-pointer ${idx === currentStep ? 'w-8 bg-primary' : 'w-2 bg-[#3b3f54] hover:bg-white/20'}`} >
))}
{/* Main Text Content */}
Step {currentStep + 1} of {STEPS.length}

{step.title}

{step.description}

{step.features.map((feature, idx) => (
check_circle {feature}
))}
{/* Footer Actions */}
); }