feat: khi người dùng click vào nút Chi tiết hành trình thì sẽ dựa vào ngày của hệ thống mà chuyển đến Chặng đó

This commit is contained in:
2026-06-24 21:17:26 +07:00
parent e385049652
commit 5e60614588
12 changed files with 75 additions and 255 deletions
@@ -203,12 +203,14 @@ export const ItineraryTimeline = ({
const allLocations = useMemo(() => legs.flatMap(l => l.locations), [legs]);
useEffect(() => {
console.log("ItineraryTimeline: Legs updated", legs);
// Initialize first leg as expanded when legs change
if (legs.length > 0 && !expandedStageId) {
const storedLegId = sessionStorage.getItem('defaultExpandedLegId');
if (storedLegId) {
setExpandedStageId(storedLegId);
sessionStorage.removeItem('defaultExpandedLegId');
} else if (legs.length > 0 && !expandedStageId) {
setExpandedStageId(legs[0].id);
}
}, [legs]);
}, [legs, expandedStageId]);
return (
<div id="itinerary-timeline-print-zone" className="timeline-scroll-container itinerary-timeline-container">