import * as React from 'react';
import { FixedSizeList as List } from 'react-window';
import { type IHistoryState } from '../../Interfaces/IHistoryState';
import { TITLE_BAR_HEIGHT } from '../Sidebar/Sidebar';
interface IHistoryProps {
history: IHistoryState[]
historyCurrentStep: number
jumpTo: (move: number) => void
}
export function History(props: IHistoryProps): JSX.Element {
function Row({ index, style }: { index: number, style: React.CSSProperties }): JSX.Element {
const reversedIndex = (props.history.length - 1) - index;
const step = props.history[reversedIndex];
const desc = step.lastAction;
const selectedClass: string = reversedIndex === props.historyCurrentStep
? 'border-l-4 bg-blue-500 shadow-lg shadow-blue-500/60 hover:bg-blue-600 hover:shadow-blue-500 text-slate-50'
: 'bg-slate-300/60 hover:bg-slate-400 hover:shadow-slate-400';
return (
);
}
return (
{Row}
);
}