import * as React from 'react'; import { FixedSizeList as List } from 'react-window'; import { IHistoryState } from '../../Interfaces/IHistoryState'; interface IHistoryProps { history: IHistoryState[] historyCurrentStep: number isOpen: boolean jumpTo: (move: number) => void } export const History: React.FC = (props: IHistoryProps) => { const isOpenClasses = props.isOpen ? 'right-0' : '-right-64'; const 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 = reversedIndex === props.historyCurrentStep ? 'bg-blue-500 hover:bg-blue-600' : 'bg-slate-500 hover:bg-slate-700'; return ( ); }; return (
Timeline
{ Row }
); };