import { useState, useEffect } from 'react' import { X, ChevronRight, ChevronLeft, HelpCircle, Zap, Layers, Share2, Palette, Code } from 'lucide-react' import { useTutorial } from './TutorialContext' const tutorialSteps = [ { id: 'toolbar', title: 'The Toolbar', description: 'Access all neural layer types and tools from here. Drag nodes onto the canvas to start building.', position: { top: '120px', left: '20px' }, target: 'toolbar' }, { id: 'canvas', title: 'Design Canvas', description: 'This is your main workspace. Drop nodes here and connect them to create your neural architecture.', position: { top: '50%', left: '50%', transform: 'translate(-50%, -50%)' }, target: 'canvas' }, { id: 'properties', title: 'Properties Panel', description: 'Select any node to view and edit its parameters here. All layer configurations are centralized.', position: { top: '120px', right: '20px' }, target: 'properties-panel' }, { id: 'connections', title: 'Making Connections', description: 'Click and drag from one node\'s output to another\'s input to create data flow connections.', position: { top: '50%', left: '50%', transform: 'translate(-50%, -50%)' }, target: 'canvas' }, { id: 'export', title: 'Export & Share', description: 'Export your architecture to code or share with your team. Supports PyTorch, TensorFlow, and more.', position: { bottom: '120px', right: '20px' }, target: 'export-button' }, { id: 'theme', title: 'Dark Mode', description: 'Toggle between light and dark themes for comfortable viewing in any environment.', position: { top: '20px', right: '20px' }, target: 'theme-toggle' }, { id: 'complete', title: 'Tutorial Complete!', description: 'You\'re ready to start building. Remember, you can always access this tutorial from the help menu.', position: { top: '50%', left: '50%', transform: 'translate(-50%, -50%)' }, target: null } ] export default function TutorialOverlay() { const { currentStep, nextStep, previousStep, endTutorial } = useTutorial() const [isVisible, setIsVisible] = useState(false) const [highlightedElement, setHighlightedElement] = useState(null) useEffect(() => { setIsVisible(true) const timer = setTimeout(() => { const step = tutorialSteps[currentStep] if (step.target) { const element = document.querySelector(`[data-tutorial-target="${step.target}"]`) setHighlightedElement(element) } else { setHighlightedElement(null) } }, 100) return () => clearTimeout(timer) }, [currentStep]) const handleNext = () => { if (currentStep < tutorialSteps.length - 1) { nextStep() } else { endTutorial() } } const handlePrevious = () => { if (currentStep > 0) { previousStep() } } const currentTutorialStep = tutorialSteps[currentStep] return ( <> {/* Overlay */}
{/* Highlight Overlay */} {highlightedElement && (}
{currentStep === 5 && {currentTutorialStep.description}
{/* Actions */}