// Bottom tab bar — persistent on idle screens // Tabs (RTL, leading edge = right): // home الرئيسية rightmost // earnings الأرباح // wallet المحفظة // profile حسابي leftmost // // Hidden on active-order, incoming alert, cash, completed. const TABS = [ { id: 'home', label: 'الرئيسية', icon: 'home-solid', iconOutline: 'home-outline' }, { id: 'orders', label: 'الطلبات', icon: 'list-solid', iconOutline: 'list-outline' }, { id: 'earnings', label: 'الأرباح', icon: 'chart-solid', iconOutline: 'chart-outline' }, { id: 'wallet', label: 'المحفظة', icon: 'wallet-solid', iconOutline: 'wallet-outline' }, { id: 'profile', label: 'حسابي', icon: 'user-solid', iconOutline: 'user-outline' }, ]; // Inline SVG tab icons — solid + outline pair function TabIcon({ name, size = 26, color = 'currentColor', solid }) { const s = { width: size, height: size, viewBox: '0 0 24 24' }; if (name === 'list') { return solid ? : ; } if (name === 'home') { return solid ? : ; } if (name === 'chart') { return solid ? : ; } if (name === 'wallet') { return solid ? : ; } if (name === 'user') { return solid ? : ; } return null; } // ───────────────────────────────────────────────────────────── // TabBar — 64px tall, RTL so home tab is on the right // ───────────────────────────────────────────────────────────── function TabBar({ active, onChange }) { return (
{TABS.map((t) => { const isActive = active === t.id; const iconName = t.icon.replace('-solid','').replace('-outline',''); return ( ); })}
); } // ───────────────────────────────────────────────────────────── // AppTopBar — idle screens. Avatar on right (RTL leading), bell on left. // ───────────────────────────────────────────────────────────── function AppTopBar({ title, online, badge = 0 }) { return (
{/* Avatar (leading = right in RTL) */}
م {/* online dot on avatar */}
{title && (
أهلاً،
{title}
)}
{/* Bell (trailing = left in RTL) */}
); } Object.assign(window, { TabBar, AppTopBar, TabIcon });