'use client'; import { motion, AnimatePresence } from 'framer-motion'; import { useEffect, useState } from 'react'; import { NAV_ITEMS, scrollToSection } from '@/config/navigation'; import { cn } from '@/lib/utils'; import { ThemeToggle } from '@/components/ui/ThemeToggle'; import { useSidebar } from '@/providers/SidebarContext'; const STAT_CARDS = [ { icon: '🎙️', title: 'Whisper ASR', value: '99.2%', sub: 'Transcription accuracy', accent: 'from-blue-500/20 to-blue-500/5', dot: 'bg-blue-500', }, { icon: '👥', title: 'Speaker ID', value: 'Auto', sub: 'Agent & customer split', accent: 'from-violet-500/20 to-violet-500/5', dot: 'bg-violet-500', }, { icon: '⚡', title: 'Low Latency', value: '< 2s', sub: 'Real-time pipeline', accent: 'from-emerald-500/20 to-emerald-500/5', dot: 'bg-emerald-500', }, ]; export function Sidebar() { const { collapsed, toggle } = useSidebar(); const [activeSection, setActiveSection] = useState('hero'); const [cardIndex, setCardIndex] = useState(0); const [hoveredItem, setHoveredItem] = useState(null); useEffect(() => { const handleScroll = () => { const scrollPosition = window.scrollY + window.innerHeight / 3; for (const item of NAV_ITEMS) { const section = document.getElementById(item.id); if ( section && section.offsetTop <= scrollPosition && section.offsetTop + section.offsetHeight > scrollPosition ) { setActiveSection(item.id); } } }; window.addEventListener('scroll', handleScroll, { passive: true }); return () => window.removeEventListener('scroll', handleScroll); }, []); // Auto-cycle cards every 3 seconds useEffect(() => { if (collapsed) return; const timer = setInterval(() => { setCardIndex((prev) => (prev + 1) % STAT_CARDS.length); }, 3000); return () => clearInterval(timer); }, [collapsed]); const card = STAT_CARDS[cardIndex]; return (
S
{!collapsed && (
Speech Intelligence and Intent Detection
Audio Intelligence
)}
{/* Toggle Button */}
{!collapsed && (

Navigation

)}
{!collapsed && ( <> {/* Auto-sliding feature stat card */}
{card.icon} {card.title}

{card.value}

{card.sub}

{/* Dot indicators */}
{STAT_CARDS.map((_, i) => (

Platform

Enterprise audio pipeline

Whisper · LLaMA · XGBoost

)}
); }