/* popeat.es — assembled recreation. */
function App() {
  const { SiteHeader, SiteFooter, FloatWhatsApp } = window.PE;
  const C = window.PE_CONTENT;
  const [lang, setLang] = React.useState('es');
  const [booking, setBooking] = React.useState(null);
  const t = C.i18n[lang] || C.i18n.es;
  const b = C.business;
  const openBooking = function (id) { setBooking(id || 'basic'); };

  const links = [
    {label: t.nav.about, href: '#about'}, {label: t.nav.services, href: '#services'},
    {label: t.nav.prices, href: '#prices'}, {label: t.nav.birthdays, href: '#birthdays'},
    {label: t.nav.menu, href: '#menu'}, {label: t.nav.gallery, href: '#gallery'},
    {label: t.nav.faq, href: '#faq'}, {label: t.nav.contact, href: '#contact'}
  ];

  return (
    <div lang={lang}>
      <SiteHeader logoSrc="../../assets/logo/pop-eat-logo.png" links={links} lang={lang} langs={Object.keys(C.i18n)}
        onLangChange={setLang} cta={{label: t.cta.book, onClick: function () { openBooking('basic'); }}} />
      <Hero t={t} onBook={function () { openBooking('basic'); }} />
      <About t={t} />
      <Services t={t} />
      <Prices t={t} />
      <Birthdays t={t} lang={lang} onBook={openBooking} />
      <Cafe t={t} />
      <Gallery t={t} />
      <Reviews t={t} />
      <Faq t={t} />
      <Contact t={t} />
      <SiteFooter logoSrc="../../assets/logo/pop-eat-logo.png" tagline={t.footer.tag}
        columns={[
          {title: t.footer.contact, items: [{label: b.phoneLabel, href: b.phone}, {label: b.email, href: 'mailto:' + b.email}, b.address]},
          {title: t.footer.hours, items: t.contact.hoursDetail.split(' · ')},
          {title: t.footer.follow, items: [{label: 'Instagram @popeat.es', href: b.instagram, external: true}, {label: 'Facebook /PopEat.es', href: b.facebook, external: true}, {label: 'WhatsApp', href: b.whatsapp, external: true}]}
        ]}
        copyright={'© 2026 POP EAT Adeje. ' + t.footer.rights} />
      <FloatWhatsApp href={b.whatsapp} />
      {booking ? <BookingModal t={t} lang={lang} pkgId={booking} onClose={function () { setBooking(null); }} /> : null}
    </div>
  );
}

Object.assign(window, { App });
