You are building a small React feature that displays real-time statistics from a log stream.
Each incoming event has:
category
: string (e.g.,
"auth"
,
"payments"
)
timestamp
: ISO-8601 string or epoch milliseconds (time the event occurred)
Example event:
{ "category": "auth", "timestamp": "2025-12-15T10:15:30Z" }
Implement a React component (or a small set of components) that:
onEvent(event)
or via a mocked interval).
category
.
timestamp
seen for that category
Map
(or justify an alternative) to store per-category stats.