'use client'; import { useState, useEffect } from 'react'; import { Users, Bike, DollarSign, TrendingUp, Activity, ArrowUpRight, ArrowDownRight, Clock, Shield, AlertTriangle, CheckCircle, XCircle, RefreshCw, Search, Lock, Unlock, Volume2, ShieldAlert, Cpu, Terminal, Settings, ChevronRight, Database, PlusCircle, Wrench, BatteryCharging, CreditCard, FileText, Check, ArrowDownUp, Ticket, UserCheck, Eye, Trash2 } from 'lucide-react'; import { kycRequests as mockKycRequests, bikes as mockBikes, rentals as mockRentals, transactions as mockTransactions } from '@/data/mockData'; import toast from 'react-hot-toast'; import Link from 'next/link'; interface AuditLog { id: string; timestamp: string; source: 'FLEET' | 'KYC' | 'SWAP' | 'ACCOUNTING' | 'USER'; level: 'info' | 'warning' | 'critical' | 'success'; message: string; } const initialAuditLogs: AuditLog[] = [ { id: 'log-1', timestamp: '23:25:12', source: 'FLEET', level: 'info', message: 'EV Bike Plate Dhaka Metro-1290 reported battery status at 88%' }, { id: 'log-2', timestamp: '23:24:45', source: 'KYC', level: 'success', message: 'Front Desk submitted TIN verification for Biker USR-009' }, { id: 'log-3', timestamp: '23:22:10', source: 'SWAP', level: 'warning', message: 'Gulshan Swap Station Cabinet #5 reported abnormal temperature cell rise (48°C)' }, { id: 'log-4', timestamp: '23:20:05', source: 'ACCOUNTING', level: 'info', message: 'Journal Draft JV-2026-004 auto-posted for Biker rental fee payment' }, { id: 'log-5', timestamp: '23:18:15', source: 'USER', level: 'critical', message: 'Overdue Lock Pending for Bike Plate Dhaka Metro-5621 (Farid Ahmed)' } ]; const mockLiveMessages = [ { source: 'FLEET' as const, level: 'info' as const, message: 'GPS coordinates synced for Yadea DT3 (Dhaka Metro-004)' }, { source: 'SWAP' as const, level: 'success' as const, message: 'Biker Rahim Ahmed completed battery swap in 18 seconds (Cabinet #2)' }, { source: 'ACCOUNTING' as const, level: 'success' as const, message: 'Payment gateway captured ৳300 auto-inflow for single rent' }, { source: 'FLEET' as const, level: 'warning' as const, message: 'Speed alert triggered: EV Dhaka Metro-1290 exceeded 55 km/h in urban zone' }, { source: 'KYC' as const, level: 'info' as const, message: 'Biker Jamal Uddin completed verification of email address' }, { source: 'SWAP' as const, level: 'critical' as const, message: 'Cabinet #8 in Banani Station reported battery lock failure' }, { source: 'ACCOUNTING' as const, level: 'info' as const, message: 'Investor return ledger recalculated for gold plan tier' } ]; export default function AdminDashboard() { // Simulated Roles: super_admin | hub_manager | accountant | front_desk const [activeRole, setActiveRole] = useState<'super_admin' | 'hub_manager' | 'accountant' | 'front_desk'>('super_admin'); // Live Dynamic State const [kycRequests, setKycRequests] = useState(mockKycRequests); const [telematicsBikes, setTelematicsBikes] = useState([ { id: 'tel-1', model: 'Etron ET50', plateNumber: 'Dhaka Metro Cha-1234', batteryLevel: 78, location: 'Gulshan 1', status: 'rented' }, { id: 'tel-2', model: 'Yadea DT3', plateNumber: 'Dhaka Metro Cha-5678', batteryLevel: 95, location: 'Banani', status: 'available' }, { id: 'tel-3', model: 'AIMA Lightning', plateNumber: 'Dhaka Metro Cha-9012', batteryLevel: 62, location: 'Uttara', status: 'rented' }, { id: 'tel-4', model: 'TVS iQube', plateNumber: 'Dhaka Metro Cha-3456', batteryLevel: 45, location: 'Workshop', status: 'available' } ]); const [rentalsList, setRentalsList] = useState(mockRentals); const [auditLogs, setAuditLogs] = useState(initialAuditLogs); const [activeChartMetric, setActiveChartMetric] = useState<'revenue' | 'utilization' | 'swaps'>('revenue'); // Interactive Filters & Searches const [kycSearch, setKycSearch] = useState(''); const [fleetSearch, setFleetSearch] = useState(''); const [sandboxMode, setSandboxMode] = useState(true); const [liveStreamActive, setLiveStreamActive] = useState(true); const [systemTime, setSystemTime] = useState(''); const [showToolsDrawer, setShowToolsDrawer] = useState(false); // Hub Manager Interactive battery cabinet states const [cabinetSlots, setCabinetSlots] = useState([ { slot: 1, charge: 98, status: 'fully_charged', temp: 31 }, { slot: 2, charge: 95, status: 'fully_charged', temp: 32 }, { slot: 3, charge: 15, status: 'charging', temp: 38 }, { slot: 4, charge: 88, status: 'ready', temp: 33 }, { slot: 5, charge: 5, status: 'discharged', temp: 42 }, { slot: 6, charge: 96, status: 'fully_charged', temp: 30 }, { slot: 7, charge: 0, status: 'empty', temp: 25 }, { slot: 8, charge: 91, status: 'ready', temp: 34 } ]); // Hub Manager Service Tickets const [serviceTickets, setServiceTickets] = useState([ { id: 'tkt-01', model: 'Yadea DT3', issue: 'Rear Brake Pad friction replacement', urgency: 'high', hub: 'Gulshan Hub' }, { id: 'tkt-02', model: 'TVS iQube', issue: 'Front Left LED replacement', urgency: 'medium', hub: 'Gulshan Hub' }, { id: 'tkt-03', model: 'Etron ET50', issue: 'Throttle wire connectivity check', urgency: 'low', hub: 'Banani Hub' } ]); // Accountant Interactive vouchers const [journalVouchers, setJournalVouchers] = useState([ { id: 'JV-2026-004', desc: 'Accrued Biker Rental fees single pay', debit: 45600, credit: 45600, date: '17 May', status: 'draft' }, { id: 'JV-2026-003', desc: 'Swap cabinet electricity amortization', debit: 12000, credit: 12000, date: '16 May', status: 'posted' }, { id: 'JV-2026-002', desc: 'Disbursed Investor returns Gold tier share', debit: 62100, credit: 62100, date: '15 May', status: 'posted' } ]); // Accountant past due bikers const [pastDueBikers, setPastDueBikers] = useState([ { id: 'usr-09', name: 'Farid Ahmed', pastDueAmount: 1200, lastAttempt: '14 May', mobile: '+8801700000001' }, { id: 'usr-11', name: 'Tariqul Islam', pastDueAmount: 850, lastAttempt: '15 May', mobile: '+8801700000002' } ]); // Front Desk walk-in check-in bikers queue const [walkinQueue, setWalkinQueue] = useState([ { id: 'q-1', name: 'Zahid Hasan', purpose: 'EV Assignment check-in', regDate: '17:42' }, { id: 'q-2', name: 'Mahbub Alam', purpose: 'Physical document KYC file check', regDate: '17:45' } ]); // Front Desk Ready Plates const [assignedPlateVal, setAssignedPlateVal] = useState('Dhaka Metro Cha-5678'); // Real-time ticking Clock & Live WebSocket Telemetry Simulation useEffect(() => { const updateTime = () => { const now = new Date(); setSystemTime(now.toLocaleTimeString()); }; updateTime(); const clockInterval = setInterval(updateTime, 1000); let liveLogInterval: NodeJS.Timeout; if (liveStreamActive) { liveLogInterval = setInterval(() => { const randMsg = mockLiveMessages[Math.floor(Math.random() * mockLiveMessages.length)]; const now = new Date(); const timestampStr = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' }); const newLog: AuditLog = { id: `sim-log-${Date.now()}`, timestamp: timestampStr, source: randMsg.source, level: randMsg.level, message: randMsg.message }; setAuditLogs(prev => [newLog, ...prev.slice(0, 7)]); }, 4500); } return () => { clearInterval(clockInterval); if (liveLogInterval) clearInterval(liveLogInterval); }; }, [liveStreamActive]); // Dynamic state actions const handleApproveKYC = (id: string, name: string) => { setKycRequests(prev => prev.map(k => k.id === id ? { ...k, status: 'approved' } : k)); toast.success(`Applicant ${name} successfully approved. Role updated to Biker!`); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'KYC', level: 'success', message: `Admin approved KYC document verification for Biker ${name}` }, ...prev ]); }; const handleRejectKYC = (id: string, name: string) => { setKycRequests(prev => prev.map(k => k.id === id ? { ...k, status: 'rejected' } : k)); toast.error(`Applicant ${name} KYC documents rejected.`); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'KYC', level: 'warning', message: `Admin rejected KYC files for Biker ${name} (Blurry images)` }, ...prev ]); }; const handleToggleLock = (bikeId: string, model: string, currentStatus: string) => { toast.loading(`Sending OTA secure immobilization package to EV...`, { duration: 1000 }); setTimeout(() => { setTelematicsBikes(prev => prev.map(b => { if (b.id === bikeId) { const nextStatus = b.status === 'rented' ? 'available' : 'rented'; toast.success(`Vehicle ${b.plateNumber} remote status set to: ${nextStatus === 'rented' ? 'LOCKED' : 'UNLOCKED'}`); return { ...b, status: nextStatus }; } return b; })); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'FLEET', level: 'critical', message: `OTA secure signal sent: Toggled lock state for vehicle ${model}` }, ...prev ]); }, 1000); }; const handleTriggerSiren = (plateNumber: string) => { toast.success(`Siren audio warning triggered remotely on ${plateNumber}!`, { icon: '🔊' }); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'FLEET', level: 'warning', message: `Admin triggered audio warning beacon on vehicle ${plateNumber}` }, ...prev ]); }; // Hub Manager remote opening const handleOpenCabinetSlot = (slot: number) => { toast.loading(`Issuing remote release command for swap slot #${slot}...`, { duration: 1200 }); setTimeout(() => { setCabinetSlots(prev => prev.map(s => s.slot === slot ? { ...s, status: 'empty', charge: 0 } : s)); toast.success(`Cabinet Slot #${slot} released successfully! Door opened.`, { icon: '🔓' }); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'SWAP', level: 'success', message: `Hub Manager remotely opened lock for charging slot Cabinet #${slot}` }, ...prev ]); }, 1200); }; // Dispatch mechanics const handleDispatchTicket = (id: string, issue: string) => { toast.success(`Mechanics team dispatched for ticket ${id}!`); setServiceTickets(prev => prev.filter(t => t.id !== id)); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'FLEET', level: 'info', message: `Service Ticket ${id} dispatched: ${issue}` }, ...prev ]); }; // Accountant post voucher const handlePostVoucher = (id: string) => { setJournalVouchers(prev => prev.map(v => v.id === id ? { ...v, status: 'posted' } : v)); toast.success(`Journal Voucher ${id} posted successfully to double-entry ledger!`, { icon: '📝' }); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'ACCOUNTING', level: 'success', message: `Accountant posted Journal Entry ${id} to active books` }, ...prev ]); }; // Accountant trigger warning SMS const handleSendBillWarning = (name: string, amt: number) => { toast.success(`Past due payment reminder of ৳${amt} sent to ${name}!`, { icon: '💬' }); const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'USER', level: 'warning', message: `SMS payment collection reminder dispatched to ${name} (৳${amt})` }, ...prev ]); }; // Front Desk Check-in biker Walk-in assignment const handleAssignBikerWalkin = (qId: string, name: string) => { toast.success(`EV plate ${assignedPlateVal} successfully assigned to Checked-in biker ${name}!`, { icon: '🏍️' }); setWalkinQueue(prev => prev.filter(q => q.id !== qId)); // Add Yadea/TVS assignment update const now = new Date().toLocaleTimeString(); setAuditLogs(prev => [ { id: `audit-${Date.now()}`, timestamp: now, source: 'USER', level: 'success', message: `Front Desk checked-in walk-in Biker ${name} to vehicle ${assignedPlateVal}` }, ...prev ]); }; // Environmental load simulations const runSimulatorTool = (type: string) => { setShowToolsDrawer(false); toast.loading(`Applying simulation conditions...`, { duration: 1000 }); setTimeout(() => { const now = new Date().toLocaleTimeString(); switch (type) { case 'rain': toast.success('Simulation active: Monsoon load applied! Restricting speed limit.'); setAuditLogs(prev => [ { id: `sim-${Date.now()}`, timestamp: now, source: 'FLEET', level: 'warning', message: 'Load rules: Monsoon weather limits active. Battery cell lock set to 45°C.' }, ...prev ]); break; case 'swaps': toast.success('Simulation: Grid peak loading limits active.'); setAuditLogs(prev => [ { id: `sim-${Date.now()}`, timestamp: now, source: 'SWAP', level: 'info', message: 'Power stress: Grid swap balancer activated. Fast charge locked.' }, ...prev ]); break; case 'backup': toast.success('Ledger journals compressed and backed up.'); setAuditLogs(prev => [ { id: `sim-${Date.now()}`, timestamp: now, source: 'ACCOUNTING', level: 'success', message: 'Secure ledger checkpoint drafted and saved to backup servers' }, ...prev ]); break; default: return; } }, 1000); }; // Filter calculations const pendingKYCList = kycRequests.filter(k => k.status === 'pending'); const activeRentalsCount = rentalsList.filter(r => r.status === 'active').length; const totalBikersCount = 156 + (kycRequests.filter(k => k.status === 'approved').length); const filteredKYCs = pendingKYCList.filter(k => { const q = kycSearch.toLowerCase(); return k.userName.toLowerCase().includes(q) || k.phone.includes(q); }); const filteredFleet = telematicsBikes.filter(b => { const q = fleetSearch.toLowerCase(); return b.model.toLowerCase().includes(q) || b.plateNumber.toLowerCase().includes(q) || b.location.toLowerCase().includes(q); }); return (
{/* 👑 SUPER ADMIN SECURITY HEADER BANNER WITH DYNAMIC ROLE SWITCHER */}

JAIBEN Operations Command Center

👑 SUPER ADMIN ACCESS {sandboxMode && ( Sandbox Active )}

Real-time telemetry, OTA secure triggers, and accounting ledger supervisor node

{/* DYNAMIC ROLE IMPERSONATION dropdown */}
Role Node:
{/* ========================================================================================================= */} {/* 1. 👑 SUPER ADMIN VIEW / STATS / WORKSPACES */} {/* ========================================================================================================= */} {activeRole === 'super_admin' && ( <> {/* STATS */}
{[ { label: 'Total active Bikers', value: totalBikersCount, change: '+14%', trend: 'up', icon: Users, color: 'text-blue-600 border-blue-100 bg-blue-50/30' }, { label: 'Live Active Rentals', value: activeRentalsCount, change: '+18%', trend: 'up', icon: Bike, color: 'text-emerald-600 border-emerald-100 bg-emerald-50/30' }, { label: 'Aggregate Cash Flow', value: '৳984.6k', change: '+28%', trend: 'up', icon: DollarSign, color: 'text-purple-600 border-purple-100 bg-purple-50/30' }, { label: 'Cabinet Swaps (24h)', value: '254', change: '-4%', trend: 'down', icon: TrendingUp, color: 'text-amber-600 border-amber-100 bg-amber-50/30' } ].map((stat, i) => { const Icon = stat.icon; return (
{stat.trend === 'up' ? : } {stat.change}

{stat.value}

{stat.label}

); })}
{/* TELEMETRY CHARTS & LOG TERMINAL */}

Telemetry Analytics

Live operational ledger logs plotted against target performance guidelines

{[ { id: 'revenue', label: 'Revenue Curve' }, { id: 'utilization', label: 'Utilization' }, { id: 'swaps', label: 'Cabinet stress' } ].map(opt => ( ))}
{/* Hand-Crafted Interactive Vector Graph */}
Active Operations Target Projection
{activeChartMetric === 'revenue' && ( Date: 17th May ৳45,600 Daily Mon Tue Wed Thu Fri )} {activeChartMetric === 'utilization' && ( Utilization rate 78% capacity Mon Tue Wed Thu Fri )} {activeChartMetric === 'swaps' && ( Swaps volume 254 completed Mon Tue Wed Thu Fri )}
{/* LIVE TELEMETRY BLACK FEED TERMINAL */}

Live Telemetry Feed

{auditLogs.map(log => { const colors = { info: 'text-blue-400', warning: 'text-amber-400', critical: 'text-red-400 font-bold', success: 'text-emerald-400' }; return (
[{log.timestamp}] source: {log.source} {log.level}

{log.message}

); })}
Telemetry synchronized
{/* DUAL WORKSPACE: INTERACTIVE KYC DESK & TELEMATICS FLEET CONTROL */}
{/* KYC Pending Desk */}

KYC Pending Desk

{pendingKYCList.length} requests await secure super-admin sign-off

setKycSearch(e.target.value)} className="pl-8 pr-3 py-1 border border-slate-200 rounded-lg text-xs bg-white text-slate-700 focus:outline-none focus:ring-1 focus:ring-accent" />
{filteredKYCs.map(kyc => (

{kyc.userName}

{kyc.phone}

TIN Verified NID Match
{kyc.submittedAt}
))} {filteredKYCs.length === 0 && (

No pending KYC files.

)}
{/* Live Hardware EV Fleet lock controller dashboard */}

OTA Vehicle Telematics Dashboard

Direct OTA remote control node to override vehicle immobilizers or warn operators

setFleetSearch(e.target.value)} className="pl-8 pr-3 py-1 border border-slate-200 rounded-lg text-xs bg-white text-slate-700 focus:outline-none focus:ring-1 focus:ring-accent" />
{/* Desktop Table View */}
{filteredFleet.map(bike => { const isRented = bike.status === 'rented'; return ( ); })}
EV Info Charge status Audit location OTA Lock Override Siren Warning

{bike.model}

{bike.plateNumber}
70 ? 'bg-green-500' : bike.batteryLevel > 30 ? 'bg-amber-500' : 'bg-red-500' }`} /> {bike.batteryLevel}%
{bike.location}
{/* Mobile Card Layout */}
{filteredFleet.map(bike => { const isRented = bike.status === 'rented'; return (

{bike.model}

{bike.plateNumber}

70 ? 'bg-green-500' : bike.batteryLevel > 30 ? 'bg-amber-500' : 'bg-red-500' }`} /> {bike.batteryLevel}%
Audit Location: {bike.location}
); })}
)} {/* ========================================================================================================= */} {/* 2. 🏢 HUB MANAGER VIEW / STATS / WORKSPACES */} {/* ========================================================================================================= */} {activeRole === 'hub_manager' && ( <> {/* STATS */}
{[ { label: 'Total EV Hub Inventory', value: '28 Bikes', change: '100% capacity', icon: Bike, color: 'text-blue-600 border-blue-100 bg-blue-50/30' }, { label: 'Swappable Battery Cells', value: '84 Cells', change: 'Gulshan Hub', icon: BatteryCharging, color: 'text-emerald-600 border-emerald-100 bg-emerald-50/30' }, { label: 'Active Charging Cabinets', value: '16 Slots', change: '8 empty slots', icon: Cpu, color: 'text-purple-600 border-purple-100 bg-purple-50/30' }, { label: 'Pending Service Tickets', value: serviceTickets.length, change: '2 critical dispatches', icon: Wrench, color: 'text-amber-600 border-amber-100 bg-amber-50/30' } ].map((stat, i) => { const Icon = stat.icon; return (
{stat.change}

{stat.value}

{stat.label}

); })}
{/* TELEMETRY CHARTS & THERMAL SPECTRUMS */}

Hub Grid Thermal Balancing Curve

Gulshan Cabinet battery temperature levels monitored during concurrent quick swap balancing

{/* Temp Curve (Normal limits: 30-45 deg C) */} Cell Temp 38°C Balanced 08:00 12:00 16:00 20:00 23:00
{/* LIVE TELEMETRY BLACK FEED TERMINAL */}

Live Telemetry Feed

{auditLogs.filter(l => l.source === 'SWAP' || l.source === 'FLEET').map(log => (
[{log.timestamp}] source: {log.source}

{log.message}

))}
Hub Telemetry synced
{/* DUAL WORKSPACE: INTERACTIVE CABINET DOOR RELEASER & SERVICE TICKETS */}
{/* Interactive Cabinet Slots Releaser */}

Gulshan Swap Cabinet #1

Click to remotely release slot electromagnet lock during hardware issues

{cabinetSlots.map(cab => { const isEmpty = cab.status === 'empty'; const isCharging = cab.status === 'charging'; return ( ); })}
{/* Service / Maintenance Tickets Desk */}

Active Maintenance Ticket queue

Authorize physical mechanics team dispatchments to handle bike failures

{serviceTickets.map(tkt => (
{tkt.model} {tkt.id} {tkt.urgency} Urgency

{tkt.issue}

))} {serviceTickets.length === 0 && (

All service tickets resolved! Hub operational.

)}
)} {/* ========================================================================================================= */} {/* 3. 💼 ACCOUNTANT VIEW / STATS / WORKSPACES */} {/* ========================================================================================================= */} {activeRole === 'accountant' && ( <> {/* STATS */}
{[ { label: 'Daily Rental Inflow', value: '৳45,600', change: '+23% daily', icon: DollarSign, color: 'text-blue-600 border-blue-100 bg-blue-50/30' }, { label: 'Total Rental Earnings', value: '৳128,400', change: 'Active ledger', icon: ArrowDownUp, color: 'text-emerald-600 border-emerald-100 bg-emerald-50/30' }, { label: 'Disbursed gold ROI payout', value: '৳62,100', change: '84 investors', icon: CreditCard, color: 'text-purple-600 border-purple-100 bg-purple-50/30' }, { label: 'A/R Overdue balance', value: `৳${pastDueBikers.reduce((s, b) => s + b.pastDueAmount, 0)}`, change: `${pastDueBikers.length} overdue accounts`, icon: FileText, color: 'text-amber-600 border-amber-100 bg-amber-50/30' } ].map((stat, i) => { const Icon = stat.icon; return (
{stat.change}

{stat.value}

{stat.label}

); })}
{/* TELEMETRY CHARTS & ACCOUNTING BALANCES */}

Weekly Corporate Cash Ledger curve

Rental receivables collection compared with investor yield payouts

{/* Ledger Curve */} Ledger Flow ৳128,400 Pay Mon Tue Wed Thu Fri
{/* LIVE TELEMETRY BLACK FEED TERMINAL */}

Live Telemetry Feed

{auditLogs.filter(l => l.source === 'ACCOUNTING' || l.source === 'USER').map(log => (
[{log.timestamp}] source: {log.source}

{log.message}

))}
Ledger Node synced
{/* DUAL WORKSPACE: JOURNAL ENTRIES DRAFTS & OVERDUE COLLECTIONS */}
{/* Journal Entry Drafts Desk */}

Active Journal Voucher drafts

Post auto-accrued billing vouchers to Active Corporate books

{journalVouchers.map(jv => (
{jv.id} {jv.date} {jv.status}

{jv.desc}

Debit / Credit

৳{jv.debit}

{jv.status === 'draft' ? ( ) : (
Posted
)}
))}
{/* Overdue Biker Collections desk */}

Overdue Biker Ledgers

Collect due balances or issue instant remote SMS payment warnings

{pastDueBikers.map(bkr => (

{bkr.name}

{bkr.mobile}

Past Due

৳{bkr.pastDueAmount}

))}
)} {/* ========================================================================================================= */} {/* 4. 🙋 FRONT DESK OFFICER VIEW / STATS / WORKSPACES */} {/* ========================================================================================================= */} {activeRole === 'front_desk' && ( <> {/* STATS */}
{[ { label: 'Bikers Waiting in Queue', value: `${walkinQueue.length} Bikers`, change: 'Walk-in lobby', icon: Users, color: 'text-blue-600 border-blue-100 bg-blue-50/30' }, { label: 'Ready EV Plates in parking', value: '8 Bikes', change: 'Assigned available', icon: Bike, color: 'text-emerald-600 border-emerald-100 bg-emerald-50/30' }, { label: 'Incomplete KYC Files', value: `${kycRequests.filter(k => k.status === 'pending').length} Files`, change: 'Awaiting doc upload', icon: Shield, color: 'text-purple-600 border-purple-100 bg-purple-50/30' }, { label: 'Swaps Processed Today', value: '42 Swaps', change: 'Manual tokens issued', icon: BatteryCharging, color: 'text-amber-600 border-amber-100 bg-amber-50/30' } ].map((stat, i) => { const Icon = stat.icon; return (
{stat.change}

{stat.value}

{stat.label}

); })}
{/* TELEMETRY CHARTS & WALK-IN LOG TELEMETRY */}

Walk-in Swaps Queue density

Average wait times mapped against support hours throughout today

{/* Wait times Bar Chart SVG */} 09:00 11:00 13:00 15:00 17:00 19:00
{/* LIVE TELEMETRY BLACK FEED TERMINAL */}

Live Telemetry Feed

{auditLogs.filter(l => l.source === 'USER' || l.source === 'KYC').map(log => (
[{log.timestamp}] source: {log.source}

{log.message}

))}
Front Desk synced
{/* DUAL WORKSPACE: WALK-IN BIKE ASSIGNMENTS & KYC PHYSICAL DOCUMENTS DESK */}
{/* Walk-in Biker check-in desk */}

Walk-in Biker Assignment desk

Assign ready EV plate numbers directly to lobby checked-in bikers

{walkinQueue.map(qBkr => (

{qBkr.name}

{qBkr.purpose}

{qBkr.regDate} check-in
))} {walkinQueue.length === 0 && (

All checked-in walkins assigned! Lobby empty.

)}
{/* Incomplete KYC physical document uploads */}

Walk-in KYC Upload Queue

{pendingKYCList.length} bikers require physical document scan uploads

{pendingKYCList.slice(0, 3).map(kyc => (

{kyc.userName}

{kyc.phone} • Submitted: {kyc.submittedAt}

))}
)} {/* COMMAND COMMANDS Drawer triggers */} {activeRole === 'super_admin' && (

Super-Admin Commands Console

Rapid access control widgets to configure environment variables or databases

{[ { label: 'Sandbox Payments', active: sandboxMode, onClick: () => { setSandboxMode(!sandboxMode); toast.success(sandboxMode ? 'Sandbox payments deactivated' : 'Sandbox active'); } }, { label: 'Live Events Logs', active: liveStreamActive, onClick: () => setLiveStreamActive(!liveStreamActive) }, { label: 'Run global Load', active: false, onClick: () => setShowToolsDrawer(true) }, { label: 'Database Backup', active: false, onClick: () => runSimulatorTool('backup') } ].map((tool, i) => ( ))}
{/* Global Security Alerts Panel */}

Live Security & Telemetry alerts

Critical operating limit warnings pushed from connected swap hardware nodes

Monsoon Load Warning active

Speed limited to 30km/h for Yadea fleet elements inside high rainfall areas.

Battery inventory warnings at Gulshan station

Station has only 1 fully charged cabinet remaining. Restock is required immediately.

Dispatch Hub
)} {/* Global Simulator modal */} {showToolsDrawer && (

Run Environment Simulation

Select global environment load override conditions.

)}
); }