import React from 'react'; import cn from 'classnames'; import { getTimelinePosition } from 'App/utils'; import { Icon, Tooltip } from 'UI'; import PerformanceGraph from '../PerformanceGraph'; interface Props { list?: any[]; title: string; message?: string; className?: string; endTime?: number; renderElement?: (item: any) => React.ReactNode; isGraph?: boolean; zIndex?: number; noMargin?: boolean; } const EventRow = React.memo((props: Props) => { const { title, className, list = [], endTime = 0, isGraph = false, message = '' } = props; const scale = 100 / endTime; const _list = !isGraph && React.useMemo(() => { return list.map((item: any, _index: number) => { const spread = item.toJS ? { ...item.toJS() } : { ...item }; return { ...spread, left: getTimelinePosition(item.time, scale), }; }); }, [list]); return (
{title}
{message ? : null}
{isGraph ? ( ) : _list.length > 0 ? ( _list.map((item: any, index: number) => { return (
{props.renderElement ? props.renderElement(item) : null}
); }) ) : (
None captured.
)}
); }); export default EventRow; function RowInfo({ message }: any) { return ( ); }