const { useState: useStateApp } = React;

function App() {
  const [quoteOpen, setQuoteOpen] = useStateApp(false);
  const openQuote = () => setQuoteOpen(true);
  const goTrack = () => {
    const el = document.getElementById('rastreo');
    if (el) window.scrollTo({ top: el.offsetTop - 60, behavior: 'smooth' });
  };
  return (
    <>
      <Header onQuote={openQuote} onTrack={goTrack} />
      <main>
        <Hero onQuote={openQuote} />
        <Services />
        <WhyBand />
        <Flota />
        <Tracking />
        <QuoteCTA onQuote={openQuote} />
      </main>
      <Footer />
      {quoteOpen && <QuoteModal onClose={() => setQuoteOpen(false)} />}
    </>
  );
}
window.App = App;
