'use client'; import { useState, useEffect } from 'react'; import { usePathname } from 'next/navigation'; import { motion, AnimatePresence } from 'framer-motion'; import { Scan, GlassWater, Users, Settings, ArrowRight, X, Sparkles } from 'lucide-react'; const ONBOARDING_KEY = 'dramlog_onboarding_complete'; interface OnboardingStep { id: string; icon: React.ReactNode; title: string; description: string; } const STEPS: OnboardingStep[] = [ { id: 'welcome', icon: , title: 'Willkommen bei DramLog!', description: 'Dein persönliches Whisky-Tagebuch. Scanne, bewerte und entdecke neue Drams.', }, { id: 'scan', icon: , title: 'Scanne deine Flaschen', description: 'Fotografiere das Etikett einer Flasche – die KI erkennt automatisch alle Details.', }, { id: 'taste', icon: , title: 'Bewerte deine Drams', description: 'Füge Tasting-Notizen hinzu und behalte den Überblick über deine Lieblings-Whiskys.', }, { id: 'session', icon: , title: 'Tasting-Sessions', description: 'Organisiere Verkostungen mit Freunden und vergleicht eure Bewertungen.', }, { id: 'ready', icon: , title: 'Bereit zum Start!', description: 'Scanne jetzt deine erste Flasche mit dem orangefarbenen Button unten.', }, ]; export default function OnboardingTutorial() { const [isOpen, setIsOpen] = useState(false); const [currentStep, setCurrentStep] = useState(0); const pathname = usePathname(); useEffect(() => { // Don't show on login/auth pages if (pathname === '/login' || pathname === '/auth' || pathname === '/register') { return; } // Check if onboarding was completed const completed = localStorage.getItem(ONBOARDING_KEY); if (!completed) { // Small delay to not overwhelm on first load const timer = setTimeout(() => setIsOpen(true), 1000); return () => clearTimeout(timer); } }, [pathname]); const handleNext = () => { if (currentStep < STEPS.length - 1) { setCurrentStep(prev => prev + 1); } else { handleComplete(); } }; const handleComplete = () => { localStorage.setItem(ONBOARDING_KEY, 'true'); setIsOpen(false); }; const handleSkip = () => { localStorage.setItem(ONBOARDING_KEY, 'true'); setIsOpen(false); }; if (!isOpen) return null; const step = STEPS[currentStep]; const isLastStep = currentStep === STEPS.length - 1; return ( {/* Close button */} {/* Icon */}
{step.icon}
{/* Content */}

{step.title}

{step.description}

{/* Progress dots */}
{STEPS.map((_, index) => (
))}
{/* Buttons */}
{!isLastStep && ( )}
); }