'use client'; import { useEffect } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Home, Settings, BrainCircuit, Images, Plus, X } from 'lucide-react'; import { FaXTwitter, FaDiscord, FaYoutube } from 'react-icons/fa6'; import { createGlobalState } from 'react-global-hooks'; import ThemeToggle from './ThemeToggle'; import ThemeLogo from './ThemeLogo'; import ActiveJobWidget from './ActiveJobWidget'; export const mobileSidebarState = createGlobalState(false); const Sidebar = () => { const [isMobileOpen, setIsMobileOpen] = mobileSidebarState.use(); const pathname = usePathname(); // Close mobile menu on route change useEffect(() => { setIsMobileOpen(false); }, [pathname]); // Lock body scroll when mobile menu open useEffect(() => { if (isMobileOpen) { document.body.style.overflow = 'hidden'; } else { document.body.style.overflow = ''; } return () => { document.body.style.overflow = ''; }; }, [isMobileOpen]); const navigation = [ { name: 'Dashboard', href: '/dashboard', icon: Home }, { name: 'New Job', href: '/jobs/new', icon: Plus }, { name: 'Queue', href: '/jobs', icon: BrainCircuit }, { name: 'Datasets', href: '/datasets', icon: Images }, { name: 'Settings', href: '/settings', icon: Settings }, ]; const socialsBoxClass = 'flex flex-col items-center justify-center p-1 hover:bg-gray-800 rounded-lg transition-colors'; const socialIconClass = 'w-5 h-5 text-gray-400 hover:text-white'; const sidebarContent = ( <>

Ostris AI-Toolkit

Support AI-Toolkit {/* Social links grid */}
Ostris AI-Toolkit v{process.env.NEXT_PUBLIC_APP_VERSION}
); return ( <> {/* Desktop sidebar - always visible on md+ */}
{sidebarContent}
{/* Mobile overlay sidebar */}
setIsMobileOpen(false)} aria-hidden="true" />
{sidebarContent}
); }; export default Sidebar;