import React from 'react' import { ComposedChart, Bar, Line, Cell, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ReferenceLine, ResponsiveContainer, } from 'recharts' import { OHLCVPoint } from '../api/stockApi' interface Props { data: OHLCVPoint[] } const CustomTooltip = ({ active, payload, label }: any) => { if (!active || !payload?.length) return null const d: OHLCVPoint = payload[0]?.payload return (
{label}
{d.macd != null && (MACD: {d.macd.toFixed(3)}
)} {d.macd_signal != null && (Signal: {d.macd_signal.toFixed(3)}
)} {d.macd_hist != null && (Hist:{' '} = 0 ? 'text-green-400' : 'text-red-400'}> {d.macd_hist.toFixed(3)}
)}