// Admin screens batch 1 — Dashboard, Orders management, Rx verification queue const Astyles = { fontFamily: 'Inter, -apple-system, system-ui, sans-serif' }; // Small helper: bar chart function MiniBars({ data, color = C.blue600, max }) { const m = max || Math.max(...data.map(d => d.v)); return (
{data.map((d, i) => (
{d.hot &&
{d.v}
}
{d.l}
))}
); } // ═════════════════════════════════════════════════════════════ // AD-1) DASHBOARD // ═════════════════════════════════════════════════════════════ function AdminDashboard() { const kpis = [ { l: 'Today\u2019s revenue', v: '₹1,84,200', d: '+12.4%', up: true, Icon: IconStar, hue: 'blue' }, { l: 'Orders today', v: '342', d: '+8.1%', up: true, Icon: IconBox, hue: 'mint' }, { l: 'Avg order value', v: '₹538', d: '−2.3%', up: false, Icon: IconCart, hue: 'amber' }, { l: 'Rx pending review', v: '12', d: '3 urgent', up: false, Icon: IconRx, hue: 'rose' }, ]; const palettes = { blue: { bg: C.blue50, fg: C.blue600 }, mint: { bg: C.mint100, fg: C.mint500 }, amber: { bg: C.amber100, fg: C.amber500 }, rose: { bg: C.rose100, fg: C.rose500 } }; const recent = [ { id: '#JN-2841-09', cust: 'Aarav Kumar', items: 3, amt: 248, status: 'Packing', tone: 'blue', rx: true }, { id: '#JN-2840-77', cust: 'Meera Shah', items: 1, amt: 95, status: 'Rx review', tone: 'amber', rx: true }, { id: '#JN-2840-21', cust: 'Rohit Nair', items: 6, amt: 1284, status: 'Out for delivery', tone: 'blue', rx: false }, { id: '#JN-2839-88', cust: 'Sana Khan', items: 2, amt: 412, status: 'Delivered', tone: 'mint', rx: false }, { id: '#JN-2839-50', cust: 'Vikram Rao', items: 4, amt: 562, status: 'Delivered', tone: 'mint', rx: true }, ]; return ( New order}> {/* KPI row */}
{kpis.map((k, i) => { const p = palettes[k.hue]; return (
{k.up ? '▲' : '▼'} {k.d}
{k.v}
{k.l}
); })}
{/* Charts row */}
{/* Revenue chart */}
Revenue · last 7 days
Total ₹11,84,500
{['7D', '30D', '90D'].map((t, i) => (
{t}
))}
{/* Category split */}
Sales by category
{[ { l: 'Prescription meds', p: 52, c: C.blue600 }, { l: 'Wellness & vitamins', p: 23, c: C.mint500 }, { l: 'Devices', p: 14, c: C.amber500 }, { l: 'Lab tests', p: 11, c: C.rose500 }, ].map((r, i) => (
{r.l} {r.p}%
))}
7 products low on stock — restock soon
{/* Recent orders table */}
Recent orders
View all orders →
{['ORDER', 'CUSTOMER', 'ITEMS', 'Rx', 'AMOUNT', 'STATUS', ''].map((h, i) => ( ))} {recent.map((o, i) => ( ))}
= 2 && i <= 4 ? 'left' : 'left', padding: '10px 20px', fontWeight: 700 }}>{h}
{o.id} {o.cust} {o.items} {o.rx ? : } ₹{o.amt}
); } // ═════════════════════════════════════════════════════════════ // AD-2) ORDERS MANAGEMENT // ═════════════════════════════════════════════════════════════ function AdminOrders() { const orders = [ { id: '#JN-2841-09', cust: 'Aarav Kumar', ph: '98••• 12•••', time: '5:42 PM', items: 3, amt: 248, pay: 'UPI', status: 'Packing', tone: 'blue', rx: 'Verified' }, { id: '#JN-2840-77', cust: 'Meera Shah', ph: '99••• 03•••', time: '5:38 PM', items: 1, amt: 95, pay: 'COD', status: 'Rx review', tone: 'amber', rx: 'Pending' }, { id: '#JN-2840-21', cust: 'Rohit Nair', ph: '90••• 88•••', time: '5:21 PM', items: 6, amt: 1284, pay: 'Card', status: 'Out for delivery', tone: 'blue', rx: 'N/A' }, { id: '#JN-2839-88', cust: 'Sana Khan', ph: '70••• 45•••', time: '4:58 PM', items: 2, amt: 412, pay: 'UPI', status: 'Delivered', tone: 'mint', rx: 'N/A' }, { id: '#JN-2839-50', cust: 'Vikram Rao', ph: '88••• 12•••', time: '4:40 PM', items: 4, amt: 562, pay: 'Wallet', status: 'Delivered', tone: 'mint', rx: 'Verified' }, { id: '#JN-2839-12', cust: 'Priya Das', ph: '96••• 77•••', time: '4:12 PM', items: 1, amt: 38, pay: 'UPI', status: 'Cancelled', tone: 'rose', rx: 'N/A' }, { id: '#JN-2838-90', cust: 'Karan Mehta', ph: '93••• 21•••', time: '3:50 PM', items: 3, amt: 329, pay: 'COD', status: 'Delivered', tone: 'mint', rx: 'Verified' }, ]; const rxTone = { Verified: 'mint', Pending: 'amber', 'N/A': 'gray' }; return ( Export}> {/* Tabs + filters */}
{[ { l: 'All', c: 304, on: false }, { l: 'New', c: 12, on: true }, { l: 'Rx review', c: 12, on: false, urgent: true }, { l: 'Packing', c: 8, on: false }, { l: 'Out for delivery', c: 6, on: false }, { l: 'Delivered', c: 260, on: false }, { l: 'Cancelled', c: 6, on: false }, ].map((t, i) => (
{t.l} {t.c}
))}
Filters
{/* Table */}
{['ORDER', 'CUSTOMER', 'TIME', 'ITEMS', 'PRESCRIPTION', 'PAYMENT', 'AMOUNT', 'STATUS', ''].map((h, i) => ( ))} {orders.map((o, i) => ( ))}
{h}
{o.id}
{o.cust}
{o.ph}
{o.time} {o.items} {o.pay} ₹{o.amt}
{/* Footer */}
Showing 1–7 of 304 orders
{['‹', '1', '2', '3', '…', '44', '›'].map((p, i) => (
{p}
))}
); } // ═════════════════════════════════════════════════════════════ // AD-3) Rx VERIFICATION QUEUE (pharmacist workflow) // ═════════════════════════════════════════════════════════════ function AdminRxVerify() { const queue = [ { id: '#JN-2840-77', cust: 'Meera Shah', age: '58 · F', time: '2 min ago', items: 1, active: true, urgent: true }, { id: '#JN-2840-65', cust: 'Imran Ali', age: '41 · M', time: '6 min ago', items: 3, active: false }, { id: '#JN-2840-42', cust: 'Lakshmi N', age: '34 · F', time: '11 min ago', items: 2, active: false }, { id: '#JN-2840-18', cust: 'Deepak Roy', age: '63 · M', time: '18 min ago', items: 4, active: false, urgent: true }, ]; return ( You're on shift
}>
{/* Queue list */}
QUEUE · 12 PENDING
{queue.map((q, i) => (
{q.id} {q.urgent && URGENT}
{q.cust}
{q.age} · {q.items} item{q.items > 1 ? 's' : ''}
{q.time}
))}
{/* Detail / review pane */}
{/* Header */}
#JN-2840-77 URGENT
Meera Shah · 58 · F · uploaded 2 min ago
View patient history →
{/* Rx image */}
Uploaded prescription
{/* fake Rx doc */}
{[80, 60, 90, 50].map((w, i) => (
))}
signed
{/* zoom controls */}
Encrypted · Dr. R. Bhat, Reg. KMC-48201
{/* Requested items + decision */}
Requested items (1)
Azithromycin 500mg
Azithral · 5 tablets · ×1
{/* Checks */}
Verification checklist
{[ { l: 'Doctor name & registration valid', ok: true }, { l: 'Patient name matches account', ok: true }, { l: 'Date within 90 days', ok: true }, { l: 'Dosage legible & appropriate', ok: true }, { l: 'No controlled-substance flags', ok: true }, ].map((c, i) => (
{c.ok && }
{c.l}
))}
{/* Note */}
Add a note for the customer (optional)…
{/* Decision buttons */}
); } Object.assign(window, { AdminDashboard, AdminOrders, AdminRxVerify, MiniBars });