'use client'; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { motion, AnimatePresence } from 'framer-motion'; import { SquaresFour as LayoutDashboard, TestTube as FlaskConical, Clock, ClockCounterClockwise as History, MagnifyingGlass as Search, GearSix as Settings, BookOpen, SignOut as LogOut, Dna, List as Menu, CaretRight as ChevronRight } from '@phosphor-icons/react'; import { useAuth } from '@/contexts/auth'; import { ErrorBoundary } from '@/components/ErrorBoundary'; import { TutorialWalkthrough } from '@/components/TutorialWalkthrough'; import { AuditInsightPanel } from '@/components/AuditInsightPanel'; import { ThemeToggle } from '@/components/ui/ThemeToggle'; import { BreadcrumbSchema } from '@/components/seo/BreadcrumbSchema'; const NAV_ITEMS = [ { href: '/dashboard', icon: LayoutDashboard, label: 'Dashboard' }, { href: '/analyze', icon: FlaskConical, label: 'Analyze' }, { href: '/retrieve', icon: Search, label: 'Retrieve' }, { href: '/jobs', icon: Clock, label: 'Jobs' }, { href: '/history', icon: History, label: 'History' }, { href: '/learn', icon: BookOpen, label: 'Learn' }, { href: '/settings', icon: Settings, label: 'Settings' }, ] as const; const labelVariants = { hidden: { opacity: 0, width: 0, transition: { duration: 0.15 } }, show: { opacity: 1, width: 'auto', transition: { duration: 0.2, delay: 0.05 } }, }; function SidebarContent({ collapsed, pathname, user, signOut, }: { collapsed: boolean; pathname: string; user: { email?: string | null } | null; signOut: () => void; }) { return (
{user.email ?? 'Guest session'}