// shell.jsx — Sidebar + Topbar const { useState: useStateShell } = React; // Translation strings const T = { en: { main: 'Main', account: 'Account', home: 'Home', dashboard: 'Dashboard', myideas: 'My ideas', favorite: 'Favorite', profile: 'Profile', settings: 'Settings', logout: 'Logout', yourBalance: 'Your balance', trade: 'Trade for prizes', search: 'Search by idea name, or owner name…', newIdea: 'New Idea', ideasSystem: 'Ideas system', }, ar: { main: 'الرئيسية', account: 'الحساب', home: 'الرئيسية', dashboard: 'لوحة التحكم', myideas: 'أفكاري', favorite: 'المفضلة', profile: 'الملف الشخصي', settings: 'الإعدادات', logout: 'تسجيل الخروج', yourBalance: 'رصيدك', trade: 'استبدال الجوائز', search: 'ابحث باسم الفكرة أو المالك…', newIdea: 'فكرة جديدة', ideasSystem: 'نظام الأفكار', }, }; function Sidebar({ route, go, collapsed, balance, pendingCount, lang = 'en' }) { const Icon = window.Icon; const t = T[lang] || T.en; const main = [ { id: 'home', icon: 'home', label: t.home }, { id: 'dashboard', icon: 'grid', label: t.dashboard }, { id: 'myideas', icon: 'paper', label: t.myideas }, { id: 'favorite', icon: 'heart', label: t.favorite, badge: 4 }, ]; const account = [ { id: 'profile', icon: 'profile', label: t.profile }, { id: 'settings', icon: 'settings', label: t.settings }, ]; const Item = (it) => ( ); return ( ); } function Topbar({ toggleRail, search, setSearch, balance, onAdd, onNav, onSearchSubmit, notifOpen, setNotifOpen, unread, lang = 'en', toggleLang }) { const Icon = window.Icon; const t = T[lang] || T.en; const isAr = lang === 'ar'; return (
{ setSearch(e.target.value); onSearchSubmit(e.target.value); }} onKeyDown={e => { if (e.key === 'Enter') onSearchSubmit(e.target.value, true); }} /> ⌘K
); } Object.assign(window, { Sidebar, Topbar });