import { LineChart, XAxis, YAxis, Line, Tooltip, Legend } from "recharts"; import { timeFormat } from "d3-time-format"; import useWindowSize from '../../utils/hook-windowresize'; import styles from '../../styles/styles.module.css'; interface ToolTipProps { active?: boolean, payload?: {name: string, payload: {value: string, time: Date}}[], unit?: string } const defaultProps = { active: false, payload: Object, unit: '', }; interface TimedValue { time: Date; value: number; } interface ChartProps { data?: TimedValue[], title?: string, color: string, unit: string, dataCollections?: any[], } function CustomizedTooltip(props: ToolTipProps) { const { active, payload, unit } = props; if (active && payload && payload[0]) { const time = payload[0].payload ? timeFormat("%I:%M")(new Date(payload[0].payload.time)) : ""; const tooltipDetails = payload.map(data => { return