import { fmt } from '../../utils/units.js'; import type { VFPoint } from '../../types.js'; interface Props { point: VFPoint; /** Pending delta in kHz (from store), if any */ pendingDeltaKhz?: number; /** True if this point is being held up by monotonicity enforcement */ isClamped?: boolean; } /** * HTML tooltip rendered as an absolutely-positioned overlay on top of the * SVG so it's never clipped by the SVG viewport. */ export function CurveTooltip({ point, pendingDeltaKhz, isClamped }: Props) { const hasPending = pendingDeltaKhz !== undefined; const pendingMhz = hasPending ? pendingDeltaKhz! / 1000 : 0; const deltaChange = hasPending ? pendingDeltaKhz! - point.delta_khz : 0; const pendingEffMhz = hasPending ? point.freq_mhz + deltaChange / 1000 : null; return (