'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 (
{!collapsed && ( Synteny )}
{user && !collapsed && (

{user.email ?? 'Guest session'}

)} {!collapsed && (
SYNTENY-CORE v2.1
)}
); } export default function DashboardLayout({ children }: { children: React.ReactNode }) { const pathname = usePathname(); const { user, signOut } = useAuth(); const [collapsed, setCollapsed] = useState(false); const [mobileOpen, setMobileOpen] = useState(false); useEffect(() => { setMobileOpen(false); }, [pathname]); return (
{mobileOpen && ( <> setMobileOpen(false)} /> )}
{pathname.split('/').filter(Boolean).join(' ยท ')}
systems live
{children}
); }