'use client' import { differenceInDays, format, isWeekend, isToday } from 'date-fns' import type { GanttTask, TimelineItem } from './types' import { getHealthColor } from './lib/progress' import { ROW_HEIGHT, ZOOM_LEVELS, INDENT_WIDTH } from './hooks/useGanttState' import type { UseGanttStateReturn } from './hooks/useGanttState' export interface GanttTimelineViewProps { // Layout props infoColumnWidth: number infoColumnLabel: string showCategory: boolean showStatus: boolean showFullscreen: boolean // State from useGanttState zoomIndex: UseGanttStateReturn['zoomIndex'] setZoomIndex: UseGanttStateReturn['setZoomIndex'] collapsed: UseGanttStateReturn['collapsed'] mounted: UseGanttStateReturn['mounted'] dragState: UseGanttStateReturn['dragState'] focusedRowIndex: UseGanttStateReturn['focusedRowIndex'] dayWidth: UseGanttStateReturn['dayWidth'] tasks: UseGanttStateReturn['tasks'] startDate: UseGanttStateReturn['startDate'] days: UseGanttStateReturn['days'] months: UseGanttStateReturn['months'] timeHeaderUnits: UseGanttStateReturn['timeHeaderUnits'] dependencyPaths: UseGanttStateReturn['dependencyPaths'] timelineWidth: UseGanttStateReturn['timelineWidth'] bodyHeight: UseGanttStateReturn['bodyHeight'] isFullscreen: UseGanttStateReturn['isFullscreen'] categoryColors: UseGanttStateReturn['categoryColors'] onDateChange: UseGanttStateReturn['onDateChange'] // Refs bodyScrollRef: UseGanttStateReturn['bodyScrollRef'] headerTimelineRef: UseGanttStateReturn['headerTimelineRef'] infoColumnRef: UseGanttStateReturn['infoColumnRef'] // Handlers toggleFullscreen: UseGanttStateReturn['toggleFullscreen'] handleItemClick: UseGanttStateReturn['handleItemClick'] toggleCollapse: UseGanttStateReturn['toggleCollapse'] handleBodyScroll: UseGanttStateReturn['handleBodyScroll'] getBarPosition: UseGanttStateReturn['getBarPosition'] handleDragStart: UseGanttStateReturn['handleDragStart'] } export function GanttTimelineView({ infoColumnWidth, infoColumnLabel, showCategory, showStatus, showFullscreen, zoomIndex, setZoomIndex, collapsed, mounted, dragState, focusedRowIndex, dayWidth, tasks, startDate, days, months, timeHeaderUnits, dependencyPaths, timelineWidth, bodyHeight, isFullscreen, categoryColors, onDateChange, bodyScrollRef, headerTimelineRef, infoColumnRef, toggleFullscreen, handleItemClick, toggleCollapse, handleBodyScroll, getBarPosition, handleDragStart, }: GanttTimelineViewProps) { return ( <> {/* Header row */}