/* global React, ReactDOM */
const { useEffect, useRef, useState, useMemo, useCallback } = React;

// ===================== Nav =====================
function Nav() {
  const [scrolled, setScrolled] = useState(false);
  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 24);
    window.addEventListener("scroll", onScroll, { passive: true });
    return () => window.removeEventListener("scroll", onScroll);
  }, []);
  return (
    <header className="nav" data-scrolled={scrolled || undefined}>
      <div className="container nav-inner">
        <a href="#top" className="brand" aria-label="Yogavibe Reviews">
          <span className="brand-logo" role="img" aria-hidden="true"></span>
          <span className="brand-wordmark">Yogavibe</span>
          <span className="brand-suffix">Reviews</span>
        </a>
        <nav className="nav-links" aria-label="primary">
          <a href="#all-reviews">Reviews</a>
          <a href="#leave-review">Leave a review</a>
          <a href="#faq" className="hide-sm">FAQ</a>
          <a href="https://yogavibe.eu" className="hide-sm" target="_blank" rel="noopener">
            <span className="loc">Yogavibe.eu</span>
          </a>
        </nav>
      </div>
    </header>
  );
}

// ===================== Hero =====================
function Hero({ stats }) {
  return (
    <section className="hero container" id="top">
      <div className="hero-eyebrow-row reveal">
        <span className="eyebrow">Antwerp · Essaouira · Phuket</span>
        <span className="caption" style={{ color: "var(--ink-mute)" }}>Est. 2017</span>
      </div>

      <div className="hero-grid">
        <div className="hero-text-col">
          <h1 className="hero-headline reveal">
            What guests<br/>
            say <i>after</i><br/>
            the week.
          </h1>
          <div className="hero-side reveal">
            <p className="lead">
              Honest reflections from every guest who has joined a Yogavibe retreat.
              Verified, unedited, and gathered in one place — read them all, or add your own.
            </p>
            <div className="hero-cta-row">
              <a href="#all-reviews" className="btn btn-primary btn-arrow">
                Read all reviews <IconArrow />
              </a>
              <a href="#leave-review" className="btn btn-ghost">
                Share your story
              </a>
            </div>
          </div>
        </div>

        <figure className="hero-photo reveal">
          <img src="images/yoga-class.jpg" alt="Morning yoga class on the riad terrace in Essaouira" loading="eager" fetchpriority="high" width="1344" height="1682" />
          <figcaption>Morning class · Riad terrace, Essaouira</figcaption>
        </figure>
      </div>

      <div className="hero-stats reveal" style={{ marginTop: "clamp(36px, 5vw, 72px)" }}>
        <div>
          <div className="hero-rating-num">
            {stats.avg.toFixed(1)}<small>/5</small>
          </div>
        </div>
        <div>
          <Stars rating={stats.avg} size="lg" />
          <div className="hero-rating-meta" style={{ marginTop: 10 }}>
            Based on <strong>{stats.total} verified reviews</strong> &nbsp;·&nbsp;
            {stats.fiveStarPct}% rated five stars
          </div>
          <div className="caption" style={{ marginTop: 4, display: "flex", gap: 14, flexWrap: "wrap", alignItems: "center" }}>
            <span>Last updated · {formatDate(stats.lastDate)}</span>
            <a
              href="https://www.trustpilot.com/review/yogavibe.eu"
              target="_blank"
              rel="noopener"
              style={{ color: "var(--ink)", borderBottom: "1px solid var(--ink)", paddingBottom: 1, display: "inline-flex", gap: 6, alignItems: "center" }}
            >
              Verify on Trustpilot <IconArrow style={{ transform: "rotate(-45deg)" }} />
            </a>
          </div>
        </div>
      </div>
    </section>
  );
}

// ===================== Marquee =====================
function Marquee() {
  const items = [
    "Came back fully zen",
    "Best yoga retreat ever",
    "Food for body, mind and soul",
    "A week that reset everything",
    "A retreat beautifully in balance",
    "Everything was wonderful",
  ];
  const row = (key) => (
    <span key={key}>
      {items.map((t, i) => (
        <React.Fragment key={i}>
          <i>{t}</i>
          <span className="dot" aria-hidden="true"></span>
        </React.Fragment>
      ))}
    </span>
  );
  return (
    <div className="marquee" aria-hidden="true">
      <div className="marquee-track">
        {row("a")}
        {row("b")}
      </div>
    </div>
  );
}

// ===================== Glimpses gallery =====================
function Glimpses() {
  const photos = [
    { src: "images/surf-class.jpg",        alt: "Six guests on surfboards practising on Sidi Kaouki beach",       caption: "Surf class · Sidi Kaouki",         cols: 7, rows: 1 },
    { src: "images/dunes-group.jpg",       alt: "Group of guests posing on a sand dune above the Atlantic",       caption: "Dunes · Atlantic coast",         cols: 5, rows: 2 },
    { src: "images/riad-lunch.jpg",        alt: "Long lunch under stone arches at the riad in Essaouira",         caption: "Long lunch · The riad",            cols: 4, rows: 1 },
    { src: "images/horseback.jpg",         alt: "Three guests on horseback riding through coastal scrubland",     caption: "Horseback · Coastal trail",       cols: 3, rows: 1 },
    { src: "images/garden-meditation.jpg", alt: "Seated meditation in the garden, framed by palm fronds",         caption: "Seated meditation · Garden",      cols: 6, rows: 1 },
    { src: "images/pool-friends.jpg",      alt: "Seven guests in the riad pool, smiling",                         caption: "Afternoon swim · The pool",       cols: 6, rows: 1 },
  ];

  return (
    <section className="section-tight container" aria-label="Glimpses from the retreats">
      <div className="reveal glimpses-head">
        <span className="eyebrow">Glimpses</span>
        <h2 className="h2" style={{ marginTop: 16, maxWidth: 720 }}>
          The reviews, <i>in motion</i>.
        </h2>
      </div>

      <div className="glimpses-grid">
        {photos.map((p) => (
          <figure
            key={p.src}
            className="glimpse reveal"
            style={{ gridColumn: `span ${p.cols}`, gridRow: `span ${p.rows}` }}
          >
            <img src={p.src} alt={p.alt} loading="lazy" />
            <figcaption>{p.caption}</figcaption>
          </figure>
        ))}
      </div>
    </section>
  );
}

// ===================== Review card =====================
function ReviewCard({ r }) {
  const [expanded, setExpanded] = useState(false);
  const long = (r.body || "").length > 380;
  return (
    <article className="review" itemScope itemType="https://schema.org/Review">
      <meta itemProp="itemReviewed" content="Yogavibe" />
      <meta itemProp="author" content={r.name} />
      <meta itemProp="datePublished" content={r.date} />
      <div itemProp="reviewRating" itemScope itemType="https://schema.org/Rating">
        <meta itemProp="ratingValue" content={String(r.rating)} />
        <meta itemProp="bestRating" content="5" />
      </div>

      <div className="review-head">
        <Avatar initials={r.initials} seed={r.id} />
        <div>
          <div className="reviewer-name">{r.name}</div>
          <div className="reviewer-meta">
            {r.country ? `${r.country} · ` : ""}
            {r.reviewCount ? `${r.reviewCount} ${r.reviewCount === 1 ? "review" : "reviews"}` : "1 review"}
          </div>
        </div>
        <SourceBadge source={r.source} />
      </div>

      <div className="review-rating-row">
        <Stars rating={r.rating} />
      </div>

      <h3 className="review-title" itemProp="name">{r.title}</h3>
      <p className={`review-body ${long && !expanded ? "clamped" : ""}`} itemProp="reviewBody">
        {r.body}
      </p>
      {long && (
        <button className="review-readmore" onClick={() => setExpanded((e) => !e)}>
          {expanded ? "Show less" : "Read full review"}
        </button>
      )}

      <div className="review-foot">
        <span>{formatDate(r.date)}</span>
        {r.location && <span className="review-loc">{r.location}</span>}
      </div>
    </article>
  );
}

// ===================== Filters + feed =====================
function ReviewsFeed({ reviews }) {
  const [rating, setRating] = useState("all");
  const [sort, setSort] = useState("recent");
  const [shown, setShown] = useState(9);

  const filtered = useMemo(() => {
    let list = reviews.slice();
    if (rating !== "all") list = list.filter((r) => r.rating === Number(rating));
    if (sort === "recent") list.sort((a, b) => new Date(b.date) - new Date(a.date));
    if (sort === "oldest") list.sort((a, b) => new Date(a.date) - new Date(b.date));
    if (sort === "highest") list.sort((a, b) => b.rating - a.rating || new Date(b.date) - new Date(a.date));
    if (sort === "lowest") list.sort((a, b) => a.rating - b.rating || new Date(b.date) - new Date(a.date));
    return list;
  }, [reviews, rating, sort]);

  useEffect(() => { setShown(9); }, [rating, sort]);

  return (
    <section className="section container" id="all-reviews">
      <div className="reveal" style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-end", flexWrap: "wrap", gap: 24, marginBottom: 40 }}>
        <div>
          <span className="eyebrow">The Feed · {filtered.length} of {reviews.length}</span>
          <h2 className="h1" style={{ marginTop: 18, maxWidth: 720 }}>
            Every <i>review</i>, in one place.
          </h2>
        </div>
        <p className="lead" style={{ maxWidth: 360 }}>
          Filter by star rating or sort by date. Nothing here is paid for or moderated for tone.
        </p>
      </div>

      <div className="filter-bar reveal">
        <div className="filter-chips" role="group" aria-label="Filter by rating">
          {[
            { id: "all", label: "All ratings" },
            { id: "5", label: "5 ★" },
            { id: "4", label: "4 ★" },
          ].map((c) => (
            <button
              key={c.id}
              className="chip"
              aria-pressed={rating === c.id}
              onClick={() => setRating(c.id)}
            >
              {c.label}
            </button>
          ))}
        </div>
        <select className="sort-select" value={sort} onChange={(e) => setSort(e.target.value)} aria-label="Sort">
          <option value="recent">Most recent</option>
          <option value="oldest">Oldest first</option>
          <option value="highest">Highest rated</option>
          <option value="lowest">Lowest rated</option>
        </select>
      </div>

      {filtered.length === 0 ? (
        <div className="feed-empty">
          <p className="caption">No reviews match these filters.</p>
        </div>
      ) : (
        <>
          <div className="reviews-grid">
            {filtered.slice(0, shown).map((r) => (
              <ReviewCard key={r.id} r={r} />
            ))}
          </div>
          {shown < filtered.length && (
            <div className="load-more-row">
              <button className="btn btn-ghost btn-arrow" onClick={() => setShown((s) => s + 9)}>
                Load more reviews <IconArrow />
              </button>
            </div>
          )}
        </>
      )}
    </section>
  );
}

// ===================== Leave-a-review form =====================
const FORMSPREE_ENDPOINT = "https://formspree.io/f/xlgvbeja";

function LeaveReview() {
  const [submitted, setSubmitted] = useState(false);
  const [submitting, setSubmitting] = useState(false);
  const [rating, setRating] = useState(0);
  const [hover, setHover] = useState(0);
  const [name, setName] = useState("");
  const [country, setCountry] = useState("");
  const [email, setEmail] = useState("");
  const [title, setTitle] = useState("");
  const [body, setBody] = useState("");
  const [retreat, setRetreat] = useState("");
  const [consent, setConsent] = useState(false);
  const [err, setErr] = useState("");

  const wordCount = body.trim().split(/\s+/).filter(Boolean).length;

  async function handleSubmit(e) {
    e.preventDefault();
    setErr("");
    if (!name.trim()) return setErr("Please add your name.");
    if (!rating) return setErr("Please choose a rating.");
    if (!title.trim()) return setErr("Please add a short title.");
    if (body.trim().length < 30) return setErr("Tell us a bit more — at least a couple of sentences.");
    if (!email.trim()) return setErr("Please add your email so we can follow up.");
    if (!consent) return setErr("Please confirm you agree to publish your review.");

    setSubmitting(true);
    try {
      const payload = {
        rating: `${rating} / 5`,
        name: name.trim(),
        country: country.trim().toUpperCase().slice(0, 2),
        email: email.trim(),
        retreat: retreat.trim(),
        title: title.trim(),
        review: body.trim(),
        consent: consent ? "yes" : "no",
        _subject: `New Yogavibe review — ${rating}★ from ${name.trim()}`,
      };
      const res = await fetch(FORMSPREE_ENDPOINT, {
        method: "POST",
        headers: { "Accept": "application/json", "Content-Type": "application/json" },
        body: JSON.stringify(payload),
      });
      if (!res.ok) {
        const data = await res.json().catch(() => ({}));
        const msg = data && data.errors && data.errors[0] && data.errors[0].message
          ? data.errors[0].message
          : "Something went wrong sending your review. Please try again, or email hello@yogavibe.eu.";
        setErr(msg);
        setSubmitting(false);
        return;
      }
      setSubmitted(true);
    } catch (e2) {
      setErr("Couldn't reach the server. Please check your connection and try again.");
    } finally {
      setSubmitting(false);
    }
  }

  if (submitted) {
    return (
      <section className="form-section section" id="leave-review">
        <div className="container">
          <div className="form-success reveal">
            <div className="success-mark"><IconCheck /></div>
            <span className="eyebrow" style={{ color: "rgba(246,239,224,0.6)" }}>Thank you</span>
            <h2 className="h2">Your review is <i>in.</i></h2>
            <p className="lead">
              We've received it and will publish it on this page within a couple of days,
              after a quick check for spam. You'll get an email from Charlotte when it goes live.
            </p>
            <div style={{ display: "flex", gap: 12, marginTop: 12, flexWrap: "wrap", justifyContent: "center" }}>
              <a href="#all-reviews" className="btn btn-light btn-arrow">Back to the feed <IconArrow /></a>
              <button className="btn btn-ghost" style={{ color: "var(--bg)", borderColor: "rgba(246,239,224,0.3)" }} onClick={() => {
                setSubmitted(false); setRating(0); setName(""); setCountry(""); setEmail(""); setTitle(""); setBody(""); setRetreat(""); setConsent(false);
              }}>Submit another</button>
            </div>
          </div>
        </div>
      </section>
    );
  }

  return (
    <section className="form-section section" id="leave-review">
      <div className="container">
        <div className="form-grid">
          <div className="reveal">
            <span className="eyebrow">Direct submission</span>
            <h2 className="h1" style={{ marginTop: 18 }}>
              Share <i>your</i><br/>week with us.
            </h2>
            <p className="lead" style={{ marginTop: 18 }}>
              Whether you joined in Essaouira, Phuket, or a custom retreat —
              your honest reflection helps the next guest decide.
              We read every submission and publish it on this page after a quick check.
            </p>
            <dl className="form-meta">
              <div className="form-meta-row">
                <dt className="form-meta-key">Where it appears</dt>
                <dd className="form-meta-val">Right here on yogavibe-reviews.com, in the live feed above.</dd>
              </div>
              <div className="form-meta-row">
                <dt className="form-meta-key">Turnaround</dt>
                <dd className="form-meta-val">Usually published within 1–2 days after a quick spam check.</dd>
              </div>
              <div className="form-meta-row">
                <dt className="form-meta-key">Your data</dt>
                <dd className="form-meta-val">Email stays private. First name &amp; country shown publicly.</dd>
              </div>
            </dl>
          </div>

          <form className="form-card reveal" onSubmit={handleSubmit} noValidate>
            <div className="field">
              <label>Overall rating</label>
              <div className="rating-pick" role="radiogroup" aria-label="Star rating">
                {[1, 2, 3, 4, 5].map((n) => (
                  <button
                    key={n}
                    type="button"
                    role="radio"
                    aria-checked={rating === n}
                    data-active={(hover ? n <= hover : n <= rating) || undefined}
                    onMouseEnter={() => setHover(n)}
                    onMouseLeave={() => setHover(0)}
                    onClick={() => setRating(n)}
                    aria-label={`${n} star${n > 1 ? "s" : ""}`}
                  >
                    <svg viewBox="0 0 24 24" width="26" height="26" aria-hidden="true">
                      <path
                        d="M12 2.5l2.92 6.36 6.96.71-5.2 4.7 1.49 6.83L12 17.6l-6.17 3.5 1.49-6.83-5.2-4.7 6.96-.71L12 2.5z"
                        fill="currentColor"
                      />
                    </svg>
                  </button>
                ))}
                <span style={{ marginLeft: 12, fontFamily: "var(--font-mono)", fontSize: 11, letterSpacing: "0.12em", color: "rgba(246,239,224,0.55)", textTransform: "uppercase" }}>
                  {rating ? `${rating} of 5` : "Pick a rating"}
                </span>
              </div>
            </div>

            <div className="field-row">
              <div className="field">
                <label htmlFor="rv-name">Your name</label>
                <input id="rv-name" type="text" value={name} onChange={(e) => setName(e.target.value)} placeholder="Charlotte S." required />
              </div>
              <div className="field">
                <label htmlFor="rv-country">Country code</label>
                <input id="rv-country" type="text" value={country} onChange={(e) => setCountry(e.target.value)} placeholder="BE / NL / DE" maxLength="2" />
              </div>
            </div>

            <div className="field-row">
              <div className="field">
                <label htmlFor="rv-email">Email <span style={{ opacity: 0.6, textTransform: "none", letterSpacing: 0 }}>(kept private)</span></label>
                <input id="rv-email" type="email" value={email} onChange={(e) => setEmail(e.target.value)} placeholder="you@example.com" />
              </div>
              <div className="field">
                <label htmlFor="rv-retreat">Which retreat?</label>
                <input id="rv-retreat" type="text" value={retreat} onChange={(e) => setRetreat(e.target.value)} placeholder="Essaouira · Mar 2026" />
              </div>
            </div>

            <div className="field">
              <label htmlFor="rv-title">Headline</label>
              <input id="rv-title" type="text" value={title} onChange={(e) => setTitle(e.target.value)} placeholder="A week that stayed with me…" maxLength="80" required />
            </div>

            <div className="field">
              <label htmlFor="rv-body">Your review</label>
              <textarea id="rv-body" value={body} onChange={(e) => setBody(e.target.value)} placeholder="What was the riad like, the food, the group, the yoga? What surprised you?" rows="6" required />
            </div>

            <label className="consent-row">
              <input type="checkbox" checked={consent} onChange={(e) => setConsent(e.target.checked)} />
              <span>
                I confirm this is my honest reflection on a Yogavibe retreat, and agree to it being published
                on this page. See our <a href="#privacy">privacy notice</a>.
              </span>
            </label>

            {err && (
              <div style={{ marginTop: 14, color: "#F2C3A4", fontFamily: "var(--font-mono)", fontSize: 11, letterSpacing: "0.1em", textTransform: "uppercase" }}>
                {err}
              </div>
            )}

            <div className="form-actions">
              <span className="form-progress">
                {wordCount} word{wordCount === 1 ? "" : "s"} · {body.length}/2000
              </span>
              <button type="submit" className="btn btn-light btn-arrow" disabled={submitting}>
                {submitting ? "Sending…" : "Submit my review"} {!submitting && <IconSend />}
              </button>
            </div>
          </form>
        </div>
      </div>
    </section>
  );
}

// ===================== FAQ =====================
const FAQ_ITEMS = [
  {
    q: "Are these reviews real?",
    a: "Yes. Every review is from a guest who actually joined a Yogavibe retreat — whether collected from a verified review platform or submitted directly here. Nothing is paid for, edited for tone, or filtered out.",
  },
  {
    q: "Can I leave a review if I joined a custom retreat?",
    a: "Absolutely — drop the retreat name in the “Which retreat?” field. Custom retreats, Essaouira weeks, Phuket weeks and one-off workshops are all welcome.",
  },
  {
    q: "Will my email or last name be public?",
    a: "Your email stays private. By default we publish the name you enter and a two-letter country code only. Use a first name plus initial if you'd rather stay informal.",
  },
  {
    q: "Can a negative review be removed?",
    a: "Not for tone or content. Only for spam, impersonation, or genuine factual errors that a guest themselves asks us to correct. Honest critical feedback stays.",
  },
  {
    q: "Who runs Yogavibe?",
    a: (<>Charlotte Schoeters, based in Antwerp, Belgium — teaching since 2017. Read more on <a href="https://yogavibe.eu/about" target="_blank" rel="noopener" style={{ borderBottom: "1px solid var(--accent)", color: "var(--ink)" }}>yogavibe.eu/about</a>.</>),
  },
];

function FAQ() {
  const [open, setOpen] = useState(0);
  return (
    <section className="section container" id="faq">
      <div className="reveal faq-grid">
        <div>
          <span className="eyebrow">FAQ</span>
          <h2 className="h1" style={{ marginTop: 18 }}>
            Questions, <i>answered.</i>
          </h2>
          <p className="lead" style={{ marginTop: 18 }}>
            About how we collect and publish reviews — and a few about the retreats themselves.
            For everything else, see <a href="https://yogavibe.eu/faq" target="_blank" rel="noopener" style={{ borderBottom: "1px solid var(--accent)", color: "var(--ink)" }}>yogavibe.eu/faq</a>.
          </p>
        </div>
        <div className="faq-list">
          {FAQ_ITEMS.map((item, i) => (
            <div key={i} className="faq-item" data-open={open === i || undefined}>
              <button className="faq-q" aria-expanded={open === i} onClick={() => setOpen(open === i ? -1 : i)}>
                <span>{item.q}</span>
                <span className="faq-toggle" aria-hidden="true">{open === i ? "–" : "+"}</span>
              </button>
              <div className="faq-a">
                <div className="faq-a-inner">{item.a}</div>
              </div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ===================== Footer =====================
function Footer() {
  return (
    <footer className="footer">
      <div className="container">
        <div className="footer-grid">
          <div className="footer-brand">
            <div className="footer-brand-row">
              <span className="brand-logo brand-logo-lg" role="img" aria-hidden="true"></span>
              <span className="brand-wordmark brand-wordmark-lg">Yogavibe</span>
            </div>
            <p className="footer-tag">
              Small-group yoga retreats from Antwerp to Essaouira and beyond, since 2017.
            </p>
          </div>
          <div>
            <h4>Reviews</h4>
            <ul>
              <li><a href="#all-reviews">All reviews</a></li>
              <li><a href="#leave-review">Leave a review</a></li>
              <li><a href="#faq">FAQ</a></li>
              <li><a href="https://www.trustpilot.com/review/yogavibe.eu" target="_blank" rel="noopener">Verify on Trustpilot ↗</a></li>
            </ul>
          </div>
          <div>
            <h4>Retreats</h4>
            <ul>
              <li><a href="https://yogavibe.eu/retreats" target="_blank" rel="noopener">Upcoming retreats ↗</a></li>
              <li><a href="https://yogavibe.eu/custom-retreats" target="_blank" rel="noopener">Custom retreats ↗</a></li>
              <li><a href="https://yogavibe.eu" target="_blank" rel="noopener">Yogavibe.eu ↗</a></li>
            </ul>
          </div>
          <div>
            <h4>Contact</h4>
            <ul>
              <li>Antwerp, Belgium</li>
              <li><a href="mailto:hello@yogavibe.eu">hello@yogavibe.eu</a></li>
              <li><a href="https://instagram.com/yogavibe.eu" target="_blank" rel="noopener">Instagram ↗</a></li>
            </ul>
          </div>
        </div>
        <div className="footer-bottom">
          <span>© {new Date().getFullYear()} Yogavibe — All reviews are property of their authors.</span>
          <span>yogavibe-reviews.com</span>
        </div>
      </div>
    </footer>
  );
}

// ===================== App root =====================
function App() {
  useReveal();
  const reviews = window.YOGAVIBE_REVIEWS;

  const stats = useMemo(() => {
    const total = reviews.length;
    const sum = reviews.reduce((s, r) => s + r.rating, 0);
    const avg = total ? sum / total : 0;
    const five = reviews.filter((r) => r.rating === 5).length;
    const fiveStarPct = total ? Math.round((five / total) * 100) : 0;
    const lastDate = reviews
      .map((r) => r.date)
      .sort((a, b) => (a < b ? 1 : -1))[0] || new Date().toISOString();
    return { total, avg, fiveStarPct, lastDate };
  }, [reviews]);

  // Update the aggregateRating JSON-LD with live numbers
  useEffect(() => {
    const node = document.getElementById("ld-business");
    if (!node) return;
    try {
      const data = JSON.parse(node.textContent);
      const setAgg = (obj) => {
        if (obj && obj.aggregateRating) {
          obj.aggregateRating.ratingValue = stats.avg.toFixed(2);
          obj.aggregateRating.reviewCount = stats.total;
        }
      };
      if (Array.isArray(data["@graph"])) data["@graph"].forEach(setAgg);
      else setAgg(data);
      node.textContent = JSON.stringify(data);
    } catch (e) {}
  }, [stats]);

  return (
    <>
      <Nav />
      <main>
        <Hero stats={stats} />
        <Marquee />
        <Glimpses />
        <ReviewsFeed reviews={reviews} />
        <LeaveReview />
        <FAQ />
      </main>
      <Footer />
    </>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<App />);
