/** * 분석레포트 — 가로 봉 시간축 타임라인 (중앙 축 · 상단 매도 · 하단 매수) */ import React, { useMemo, useRef } from 'react'; import { groupEventsByBarTime, type LiveTimelineEvent, } from '../../utils/liveTradeTimeline'; import TimelineBarTimeBox from './TimelineBarTimeBox'; import TimelineAxisEventCard from './TimelineAxisEventCard'; import { useHorizontalWheelScroll } from '../../hooks/useHorizontalWheelScroll'; import { useCenterAxisTimelineScroll } from '../../hooks/useCenterAxisTimelineScroll'; import type { Timeframe } from '../../types'; const SEGMENT_COLORS = ['c0', 'c1', 'c2', 'c3', 'c4'] as const; interface Props { events: LiveTimelineEvent[]; timeframe: Timeframe; } const TimelineAxisView: React.FC = ({ events, timeframe }) => { const scrollRef = useRef(null); const trackRef = useRef(null); useHorizontalWheelScroll(scrollRef); const slots = useMemo( () => groupEventsByBarTime(events, timeframe), [events, timeframe], ); useCenterAxisTimelineScroll(scrollRef, trackRef, slots.length > 0, [slots.length, events.length]); if (slots.length === 0) { return

봉 시간 기준으로 표시할 거래 이력이 없습니다.

; } const trackMinWidth = Math.max(slots.length * 160, 320); return (
매도
{slots.map(slot => (
{slot.sells.map(ev => (
))}
))}
{slots.map((slot, i) => (
))}
{slots.map(slot => (
{slot.buys.map(ev => (
))}
))}
매수
); }; export default TimelineAxisView;