import React, { PureComponent } from 'react'; import { Action } from 'redux'; import { PerformAction } from '@redux-devtools/core'; import { Base16Theme } from 'redux-devtools-themes'; import LogMonitorEntry from './LogMonitorEntry'; interface Props> { actionsById: { [actionId: number]: PerformAction }; computedStates: { state: S; error?: string }[]; stagedActionIds: number[]; skippedActionIds: number[]; currentStateIndex: number; consecutiveToggleStartId: number | null | undefined; select: (state: S) => unknown; onActionClick: (id: number) => void; theme: Base16Theme; expandActionRoot: boolean; expandStateRoot: boolean; markStateDiff: boolean; onActionShiftClick: (id: number) => void; } export default class LogMonitorEntryList< S, A extends Action, > extends PureComponent> { render() { const elements = []; const { theme, actionsById, computedStates, currentStateIndex, consecutiveToggleStartId, select, skippedActionIds, stagedActionIds, expandActionRoot, expandStateRoot, markStateDiff, onActionClick, onActionShiftClick, } = this.props; for (let i = 0; i < stagedActionIds.length; i++) { const actionId = stagedActionIds[i]; const action = actionsById[actionId].action; const { state, error } = computedStates[i]; let previousState; if (i > 0) { previousState = computedStates[i - 1].state; } elements.push( -1} inFuture={i > currentStateIndex} selected={consecutiveToggleStartId === i} error={error} expandActionRoot={expandActionRoot} expandStateRoot={expandStateRoot} markStateDiff={markStateDiff} onActionClick={onActionClick} onActionShiftClick={onActionShiftClick} />, ); } return
{elements}
; } }