diff --git a/frontend/src/pages/DirectRates.tsx b/frontend/src/pages/DirectRates.tsx index ec9cec3..533ac10 100644 --- a/frontend/src/pages/DirectRates.tsx +++ b/frontend/src/pages/DirectRates.tsx @@ -424,17 +424,18 @@ function HotelDetailTab({ hotels, selectedHotel, onSelectHotel, data, datesLoadi - {dates.map(d => { + {(() => { const today = fmtDate(new Date()); return dates.map(d => { const day = new Date(d.stay_date + 'T12:00:00') const dow = DAYS[day.getDay()] const isWeekend = day.getDay() === 0 || day.getDay() === 5 || day.getDay() === 6 const isMinStay = !!(d.min_stay_nights && d.min_stay_nights > 1) const isFull = d.total_avail === 0 && !isMinStay + const isPast = d.stay_date < today return ( setExpandedDate(expandedDate === d.stay_date ? null : d.stay_date)} - style={{ cursor: 'pointer' }} + style={{ cursor: 'pointer', opacity: isPast ? 0.45 : 1 }} > {expandedDate === d.stay_date @@ -482,7 +483,7 @@ function HotelDetailTab({ hotels, selectedHotel, onSelectHotel, data, datesLoadi {expandedDate === d.stay_date && roomData && ( - + ) - })} + })})()}