// Hero section function Hero({ theme, t, onBook, onSocial }) { const todayIdx = (() => { const d = new Date().getDay(); return d === 0 ? 6 : d - 1; })(); const today = t.social.week[todayIdx]; const [beat, setBeat] = React.useState(0); const [status, setStatus] = React.useState({ label: t.ui.statusOpen, color: '#2fd16a' }); React.useEffect(() => { const iv = setInterval(() => setBeat((b) => (b + 1) % 4), 600); return () => clearInterval(iv); }, []); React.useEffect(() => { const update = () => { // Buenos Aires = UTC-3 const now = new Date(); const utcH = now.getUTCHours(); const utcM = now.getUTCMinutes(); const utcDay = now.getUTCDay(); // 0=Sun // BA time with wraparound let baTotal = utcH * 60 + utcM - 180; let baDay = utcDay; if (baTotal < 0) { baTotal += 1440; baDay = (baDay + 6) % 7; } const minOfDay = baTotal; // Real schedule (matches the weekly agenda). Values in minutes from 00:00. // Closings past midnight are expressed as 1440 + minutes (next day). // day index: 0=Sun ... 6=Sat // Sun 20:00 – 23:00 // Mon 20:00 – 22:00 // Tue 20:00 – 22:00 // Wed 20:00 – 01:00 (next day) // Thu 20:00 – 05:00 (next day) — "Se Picó" // Fri 19:00 – 04:00 (next day) // Sat 20:00 – 05:00 (next day) const openByDay = { 0: 1200, 1: 1200, 2: 1200, 3: 1200, 4: 1200, 5: 1140, 6: 1200 }; const closingsByDay = { 0: 1380, 1: 1320, 2: 1320, 3: 1440 + 60, 4: 1440 + 300, 5: 1440 + 240, 6: 1440 + 300 }; let isOpen = false; let closesAt = null; let opensAt = openByDay[baDay]; // Are we in today's shift? const todayOpen = openByDay[baDay]; const todayClose = closingsByDay[baDay]; if (minOfDay >= todayOpen && minOfDay < todayClose) { isOpen = true; closesAt = todayClose; } else { // check if we're in yesterday's late-night shift (closing after midnight) const prevDay = (baDay + 6) % 7; const prevClose = closingsByDay[prevDay]; if (prevClose > 1440 && minOfDay < (prevClose - 1440)) { isOpen = true; closesAt = prevClose - 1440; } } if (isOpen) { const minsLeft = closesAt - minOfDay; if (minsLeft <= 60) { setStatus({ label: t.ui.statusClosing.replace('{n}', minsLeft), color: theme.accent2 }); } else { setStatus({ label: t.ui.statusOpen, color: '#2fd16a' }); } } else { const until = (opensAt - minOfDay + 1440) % 1440; const hUntil = Math.floor(until / 60); if (hUntil === 0) { setStatus({ label: t.ui.statusOpeningMin.replace('{n}', until), color: theme.accent2 }); } else if (hUntil <= 3) { setStatus({ label: t.ui.statusOpeningHrs.replace('{n}', hUntil), color: theme.accent2 }); } else { setStatus({ label: t.ui.statusOpensToday, color: theme.ink2 }); } } }; update(); const iv = setInterval(update, 60000); return () => clearInterval(iv); }, [theme, t]); return (
● {status.label}
{ e.currentTarget.style.color = theme.accent; e.currentTarget.style.borderColor = theme.accent; }} onMouseLeave={(e) => { e.currentTarget.style.color = 'inherit'; e.currentTarget.style.borderColor = theme.ink2; }} > {t.hero.eyebrow} ↗

{t.hero.title[0]}
{t.hero.title[1]}
{t.hero.title[2]}
{t.hero.title[3]}

{t.hero.lead}

{/* Image row */}
{t.alt.heroMain}
{t.alt.heroClass}
● {t.ui.tonight}
{today.theme}
{today.hours}
{t.alt.heroNight}
); } window.Hero = Hero;