// Janaushadhi Admin — shared chrome (sidebar + topbar) for the back-office panel // Desktop 1280×900 inside browser frame. const Afont = { fontFamily: 'Inter, -apple-system, system-ui, sans-serif', color: C.ink900 }; // ── Sidebar ─────────────────────────────────────────────────── function AdminSidebar({ active = 'dashboard' }) { const groups = [ { h: null, items: [ { id: 'dashboard', l: 'Dashboard', Icon: IconHome }, ]}, { h: 'OPERATIONS', items: [ { id: 'orders', l: 'Orders', Icon: IconBox, badge: '38' }, { id: 'rx', l: 'Rx verification', Icon: IconRx, badge: '12', urgent: true }, { id: 'delivery', l: 'Delivery', Icon: IconTruck }, ]}, { h: 'CATALOG', items: [ { id: 'catalog', l: 'Products', Icon: IconPill }, { id: 'inventory', l: 'Inventory', Icon: IconScan, badge: '7', urgent: true }, { id: 'promos', l: 'Promotions', Icon: IconStar }, ]}, { h: 'PEOPLE', items: [ { id: 'customers', l: 'Customers', Icon: IconUser }, { id: 'doctors', l: 'Doctors & labs', Icon: IconShield }, { id: 'staff', l: 'Pharmacists', Icon: IconHeart }, ]}, { h: 'INSIGHTS', items: [ { id: 'analytics', l: 'Analytics', Icon: IconStar }, { id: 'settings', l: 'Settings', Icon: IconFilter }, ]}, ]; return (
{/* Brand */}
J
Janaushadhi
ADMIN CONSOLE
{/* Store switcher */}
Indiranagar store
DL-560038
{/* Nav */}
{groups.map((g, gi) => (
{g.h &&
{g.h}
}
{g.items.map(it => { const on = it.id === active; return (
{it.l} {it.badge && ( {it.badge} )}
); })}
))}
{/* User */}
SV
Suresh Verma
Store admin
); } // ── Top bar ─────────────────────────────────────────────────── function AdminTopBar({ title, sub, actions }) { return (
{title}
{sub &&
{sub}
}
{/* Search */}
Search orders, products, customers /
{actions}
); } // ── Status pill helper ──────────────────────────────────────── function AdminStatus({ label, tone }) { const tones = { blue: { bg: C.blue50, fg: C.blue600 }, mint: { bg: C.mint100, fg: '#0F5A48' }, amber: { bg: C.amber100, fg: '#7A4500' }, rose: { bg: C.rose100, fg: '#7A1C1F' }, gray: { bg: C.ink100, fg: C.ink600 || C.ink500 }, }; const t = tones[tone] || tones.gray; return ( {label} ); } // ── Admin shell wrapper ─────────────────────────────────────── function AdminShell({ active, title, sub, actions, children }) { return (
{children}
); } Object.assign(window, { AdminSidebar, AdminTopBar, AdminStatus, AdminShell });