"use client"; import { type MotionValue, motion } from "motion/react"; import { type RefObject, useId } from "react"; // Hover-highlight overlay: re-strokes the base path `d`, clipped to a vertical // band whose x/width spring to track the hovered point, so only the segment // around the dot shows brighter. The band comes from `useHighlightSegment`; // because the bright stroke reuses the base `d`, it follows whatever curve is // drawn (see `highlight-segment-bounds.ts` for the band-extent caveat). export interface HighlightSegmentProps { /** Ref to the rendered base stroke `` — its `d` is re-used verbatim. */ pathRef: RefObject; /** Whether to render (caller gates on showHighlight + active + loaded). */ visible: boolean; stroke: string; strokeWidth: number; /** Plot height — the clip band spans it fully. */ height: number; /** Spring-eased left edge of the clip band (px). */ x: MotionValue; /** Spring-eased width of the clip band (px). */ width: MotionValue; } export function HighlightSegment({ pathRef, visible, stroke, strokeWidth, height, x, width, }: HighlightSegmentProps) { const clipId = useId(); if (!(visible && pathRef.current)) { return null; } return ( <> ); } HighlightSegment.displayName = "HighlightSegment"; export default HighlightSegment;