'use client'; import { useState, useEffect, useCallback } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { X, CaretLeft as ChevronLeft, CaretRight as ChevronRight, BookOpen } from '@phosphor-icons/react'; const STEPS = [ { title: 'Welcome to Synteny', description: 'Synteny is your all-in-one bioinformatics platform. From BLAST searches to protein structure visualization, everything is designed to be fast and intuitive. This short tour will show you the essentials.', highlight: 'sidebar', }, { title: 'Running an analysis', description: 'Click any tool from the sidebar — BLAST, Alignment, Domain Analysis, and more. Paste a sequence, adjust parameters, and hit run. Results appear in seconds.', highlight: 'nav-analyze', }, { title: 'Understanding results', description: 'Results are displayed with clean, interactive visualizations. Tables, graphs, and 3D viewers help you interpret your data at a glance. Each result can be downloaded or shared.', highlight: 'results', }, { title: 'AI interpretation', description: 'Click "Interpret with AI" on any result page to get a plain-English explanation of what your results mean. The AI understands BLAST hits, pathway enrichment, domain architectures, and more.', highlight: 'ai', }, { title: 'Learning more', description: 'Visit the Learn section for in-depth documentation on every concept — E-values, bootstrap values, pLDDT scores, and dozens more. Terms marked with a (?) icon have instant explanations.', highlight: 'nav-learn', }, ]; const STORAGE_KEY = 'bio-nexus-onboarding'; export function TutorialWalkthrough() { const [step, setStep] = useState(0); const [visible, setVisible] = useState(false); useEffect(() => { const seen = localStorage.getItem(STORAGE_KEY); if (!seen) { setVisible(true); } }, []); const dismiss = useCallback(() => { setVisible(false); localStorage.setItem(STORAGE_KEY, 'true'); }, []); const next = useCallback(() => { if (step < STEPS.length - 1) { setStep(s => s + 1); } else { dismiss(); } }, [step, dismiss]); const prev = useCallback(() => { if (step > 0) { setStep(s => s - 1); } }, []); const current = STEPS[step]; return ( {visible && (

{current.title}

Step {step + 1} of {STEPS.length}

{current.description}

{/* Step dots */}
{STEPS.map((_, i) => (
))}
)} ); } export function startTutorial() { localStorage.removeItem(STORAGE_KEY); window.location.reload(); }