{events.map((e, index) => {
let isCursor = cursor === index;
- if (index === 0) cumulativeDelay = 0;
+ if (index === 0) {
+ cumulativeDelay = 0;
+ eventIndex = -1;
+ }
if (e.type === 'delay' && e.duration != null) {
cumulativeDelay += e.duration;
- } else if (e.type === 'block') cumulativeDelay = 0;
+ } else if (e.type === 'block') {
+ cumulativeDelay = 0;
+ } else if (e.type === 'event') {
+ eventIndex++;
+ }
+
return (
{
const {
type,
index,
+ eventIndex,
data,
selected,
next,
@@ -71,6 +72,7 @@ const EventListItem = (props) => {
return (