import React from 'react'; import Color from 'color'; import styles from './TimelineTooltip.module.css'; export interface TimelineTooltipProps { timeLabel: string; items: { color?: Color; value: string; label: string; }[]; } // TimelineTooltip is a generic tooltip to be used with the timeline // It contains no logic and render items as they are // Any formatting should be performed by the caller function TimelineTooltip({ timeLabel, items }: TimelineTooltipProps) { return (
{timeLabel}
{items.map((a) => ( ))}
); } function TimelineTooltipItem({ color, label, value, }: TimelineTooltipProps['items'][number]) { const ColorDiv = color ? (
) : null; return (
{ColorDiv}
{label}:
{value}
); } export { TimelineTooltip };