mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
27 lines
698 B
JavaScript
27 lines
698 B
JavaScript
import { StatusLight } from 'react-basics';
|
|
import styles from './ChartTooltip.module.css';
|
|
import ReactTooltip from 'react-tooltip';
|
|
|
|
export default function ChartTooltip({ chartId, tooltip }) {
|
|
if (!tooltip) {
|
|
return null;
|
|
}
|
|
|
|
const { title, value, label, labelColor } = tooltip;
|
|
|
|
return (
|
|
<ReactTooltip id={`${chartId}-tooltip`}>
|
|
<div className={styles.tooltip}>
|
|
<div className={styles.content}>
|
|
<div className={styles.title}>{title}</div>
|
|
<div className={styles.metric}>
|
|
<StatusLight color={labelColor}>
|
|
{value} {label}
|
|
</StatusLight>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</ReactTooltip>
|
|
);
|
|
}
|