import { getPriceChangeColor } from './chart-colors'; type CandlestickShapeProps = { cx?: number; payload?: { open: number; high: number; low: number; close: number; }; }; /** * Custom candlestick shape component for Recharts * Renders candlestick with wick and body */ export function CandlestickShape(props: CandlestickShapeProps) { const { cx, payload } = props; if (!payload || !cx) return null; const { open, high, low, close } = payload; const isPositive = close >= open; const color = getPriceChangeColor(close - open); // Calculate positions const bodyTop = Math.min(open, close); const bodyBottom = Math.max(open, close); const bodyHeight = Math.max(bodyBottom - bodyTop, 1); // Candlestick width const width = 8; return ( {/* Upper wick */} {/* Body */} {/* Lower wick */} ); }