'use client' import { useState, useRef, useEffect } from 'react' import { Menu, Zap, Settings, Bell, Activity, Sun, Moon, Globe, ChevronDown, Cpu, MonitorPlay } from 'lucide-react' import { useAppStore, type Theme, type Locale } from '@/store/useAppStore' const THEMES: { id: Theme; label: string; en: string; my: string; icon: string }[] = [ { id: 'dark', label: 'Dark', en: 'Dark', my: 'မှောင်', icon: '🌑' }, { id: 'amoled', label: 'AMOLED', en: 'AMOLED', my: 'AMOLED', icon: '⬛' }, { id: 'neon', label: 'Neon', en: 'Neon', my: 'Neon', icon: '💜' }, { id: 'glass', label: 'Glass', en: 'Glass', my: 'ဖန်ထည်', icon: '🔮' }, ] const LOCALES: { id: Locale; flag: string; label: string }[] = [ { id: 'en', flag: '🇬🇧', label: 'English' }, { id: 'my', flag: '🇲🇲', label: 'မြန်မာ' }, ] export default function TopBar() { const { sidebarOpen, setSidebarOpen, theme, setTheme, locale, setLocale, setCurrentPage, currentPage, isComputerUseOpen, setComputerUseOpen, } = useAppStore() const [themeOpen, setThemeOpen] = useState(false) const [langOpen, setLangOpen] = useState(false) const themeRef = useRef(null) const langRef = useRef(null) // Close dropdowns on outside click useEffect(() => { function handler(e: MouseEvent) { if (themeRef.current && !themeRef.current.contains(e.target as Node)) setThemeOpen(false) if (langRef.current && !langRef.current.contains(e.target as Node)) setLangOpen(false) } document.addEventListener('mousedown', handler) return () => document.removeEventListener('mousedown', handler) }, []) const currentTheme = THEMES.find(t => t.id === theme) || THEMES[0] const currentLocale = LOCALES.find(l => l.id === locale) || LOCALES[0] return (
{/* Left */}
{locale === 'my' ? 'GOD AGENT OS' : 'GOD AGENT OS'} v11 · God Mode
{/* Center - Status */}
{locale === 'my' ? 'Backend Online' : 'Backend Online'}
16 Agents · 22 Spaces
{/* Right - Controls */}
{/* Computer Use Toggle (Manus-style) */} {/* Language Toggle */}
{langOpen && (
{LOCALES.map(l => ( ))}
)}
{/* Theme Toggle */}
{themeOpen && (
{locale === 'my' ? 'အပြင်အဆင်' : 'Theme'}
{THEMES.map(t => ( ))}
)}
{/* Notifications */} {/* Settings */}
) }