import { useState, useEffect, useRef, useCallback } from "react"; // ─── GLOBAL STYLES ──────────────────────────────────────────────────────────── const GlobalStyles = () => ( ); // ─── DATA ───────────────────────────────────────────────────────────────────── const PRODUCTS = [ { id: "neuroserge", name: "NeuroSerge", tagline: "Advanced Cognitive Support Formula", emoji: "🧠", category: "Brain Health", categorySlug: "brain-health", rating: 4.7, reviews: 1284, score: 93, badge: "Editor's Choice", badgeType: "badge-gold", description: "A premium nootropic blend designed to sharpen focus, enhance memory retention, and support long-term cognitive health.", longDesc: "NeuroSerge is formulated with clinically studied ingredients — including Bacopa Monnieri, Lion's Mane Mushroom, and Alpha-GPC — to help you think clearer, work faster, and stay mentally sharp throughout the day.", scores: { Effectiveness: 95, Quality: 92, Value: 88, Safety: 96 }, benefits: ["Improved focus and concentration", "Enhanced memory and recall", "Reduced mental fatigue", "Supports neuroplasticity", "Clean energy without jitters"], ingredients: ["Bacopa Monnieri (300mg)", "Lion's Mane Mushroom Extract (500mg)", "Alpha-GPC (200mg)", "Phosphatidylserine (100mg)", "Rhodiola Rosea (200mg)", "Vitamin B6 & B12"], pros: ["Evidence-backed ingredient stack", "Third-party lab tested", "No artificial additives", "Money-back guarantee", "Non-GMO & vegan-friendly"], cons: ["Premium price point", "Results may take 2–4 weeks", "Not recommended during pregnancy"], faqs: [ { q: "How long before I see results?", a: "Most users report noticeable improvements in focus within 1–2 weeks. Full cognitive benefits typically develop over 4–8 weeks of consistent use." }, { q: "Is NeuroSerge safe to use daily?", a: "Yes, NeuroSerge is formulated for daily use. All ingredients are within safe dosage ranges and have been tested for long-term safety." }, { q: "Can I take it with coffee?", a: "Yes, many users combine NeuroSerge with their morning coffee. The formula contains no stimulants and complements caffeine well." }, { q: "Is there a money-back guarantee?", a: "Yes, the manufacturer offers a 60-day money-back guarantee if you're not satisfied with results." } ] }, { id: "joinvive", name: "JoinVive", tagline: "Premium Joint & Mobility Complex", emoji: "💪", category: "Joint Health", categorySlug: "joint-health", rating: 4.5, reviews: 876, score: 89, badge: "Top Rated", badgeType: "badge-blue", description: "A comprehensive joint support supplement combining glucosamine, chondroitin, and turmeric to restore mobility and reduce discomfort.", longDesc: "JoinVive targets joint health at multiple levels — reducing inflammation, supporting cartilage repair, and lubricating joints for smoother movement. Ideal for active adults, athletes, and those experiencing age-related joint wear.", scores: { Effectiveness: 90, Quality: 88, Value: 91, Safety: 94 }, benefits: ["Reduced joint pain and stiffness", "Improved range of motion", "Supports cartilage regeneration", "Powerful anti-inflammatory action", "Faster recovery after exercise"], ingredients: ["Glucosamine Sulfate (1500mg)", "Chondroitin Sulfate (1200mg)", "Turmeric/Curcumin (500mg)", "MSM (1000mg)", "Boswellia Extract (300mg)", "Hyaluronic Acid (80mg)"], pros: ["Clinically dosed ingredients", "Comprehensive 6-in-1 formula", "Fast-acting formula", "Suitable for vegetarians", "No shellfish fillers"], cons: ["Large capsule size", "Best results with consistent 90-day use", "Some users report mild GI adjustment"], faqs: [ { q: "Who is JoinVive best suited for?", a: "JoinVive is ideal for adults over 30, athletes, fitness enthusiasts, and anyone experiencing joint stiffness, pain, or reduced mobility." }, { q: "How quickly does it work?", a: "Many users report reduced stiffness within 2–3 weeks. Full joint support benefits are typically experienced after 6–12 weeks of use." }, { q: "Are there any drug interactions?", a: "Consult your healthcare provider before use if you take blood thinners or diabetes medications. The formula is generally safe for most adults." }, { q: "How many capsules per day?", a: "The recommended dose is 3 capsules daily with food, ideally split across meals for optimal absorption." } ] } ]; const CATEGORIES = [ { name: "Brain Health", slug: "brain-health", emoji: "🧠", count: 8 }, { name: "Joint Health", slug: "joint-health", emoji: "💪", count: 6 }, { name: "Weight Loss", slug: "weight-loss", emoji: "⚖️", count: 12 }, { name: "Sleep", slug: "sleep", emoji: "🌙", count: 7 }, { name: "Men's Health", slug: "mens-health", emoji: "🏋️", count: 9 }, { name: "Women's Health", slug: "womens-health", emoji: "🌸", count: 10 }, ]; const ARTICLES = [ { id: 1, title: "Top 7 Science-Backed Nootropics of 2025", category: "Brain Health", categorySlug: "brain-health", emoji: "🧠", excerpt: "We reviewed 40+ cognitive supplements to identify the ingredients with real clinical evidence behind them.", date: "May 28, 2025", read: "8 min read" }, { id: 2, title: "Does Glucosamine Actually Work? What the Research Says", category: "Joint Health", categorySlug: "joint-health", emoji: "💪", excerpt: "A deep-dive into decades of clinical trials to give you an honest answer about glucosamine supplementation.", date: "May 15, 2025", read: "11 min read" }, { id: 3, title: "Best Sleep Supplements: Melatonin vs. Magnesium vs. Ashwagandha", category: "Sleep", categorySlug: "sleep", emoji: "🌙", excerpt: "Comparing three of the most popular natural sleep aids to help you decide which might work best for you.", date: "May 3, 2025", read: "9 min read" }, ]; const ALL_ARTICLES = [ ...ARTICLES, { id: 4, title: "Best Testosterone Boosters for Men Over 40", category: "Men's Health", categorySlug: "mens-health", emoji: "🏋️", excerpt: "A no-nonsense look at what actually works for supporting healthy testosterone levels naturally.", date: "Apr 18, 2025", read: "10 min read" }, { id: 5, title: "Menopause & Sleep: Natural Solutions That Work", category: "Women's Health", categorySlug: "womens-health", emoji: "🌸", excerpt: "We interviewed 12 experts and analyzed the research on supplements for menopausal sleep disturbances.", date: "Apr 5, 2025", read: "12 min read" }, { id: 6, title: "The Truth About Weight Loss Pills in 2025", category: "Weight Loss", categorySlug: "weight-loss", emoji: "⚖️", excerpt: "With hundreds of options available, we break down what works, what doesn't, and what to avoid.", date: "Mar 22, 2025", read: "15 min read" }, ]; // ─── HELPERS ────────────────────────────────────────────────────────────────── // FIX: Proper half-star rating component const StarRating = ({ rating, size = 15 }) => { const stars = []; for (let i = 1; i <= 5; i++) { if (rating >= i) { stars.push(); } else if (rating >= i - 0.5) { stars.push(); } else { stars.push(); } } return
{stars}
; }; // FIX: useScrollReveal now correctly re-runs on path change via a key prop const useScrollReveal = (dep) => { useEffect(() => { const elements = document.querySelectorAll(".reveal"); if (!elements.length) return; const obs = new IntersectionObserver( (entries) => entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add("visible"); obs.unobserve(e.target); // stop watching after visible } }), { threshold: 0.08, rootMargin: "0px 0px -40px 0px" } ); elements.forEach(el => { el.classList.remove("visible"); // reset before observing obs.observe(el); }); return () => obs.disconnect(); }, [dep]); }; // ─── NAVBAR ─────────────────────────────────────────────────────────────────── const Navbar = ({ navigate, currentPath }) => { const [scrolled, setScrolled] = useState(false); const [menuOpen, setMenuOpen] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 20); window.addEventListener("scroll", onScroll, { passive: true }); return () => window.removeEventListener("scroll", onScroll); }, []); // FIX: close menu on path change useEffect(() => { setMenuOpen(false); }, [currentPath]); const nav = useCallback((path) => { navigate(path); setMenuOpen(false); window.scrollTo({ top: 0, behavior: "instant" }); }, [navigate]); const links = [ { label: "Products", path: "/" }, { label: "Categories", path: "/categories" }, { label: "Blog", path: "/blog" }, { label: "About Us", path: "/about-us" }, ]; return ( <> {/* FIX: overlay closes menu on outside click */} {menuOpen && ( <>
setMenuOpen(false)} aria-hidden="true" />
{links.map(l => ( nav(l.path)} role="menuitem"> {l.label} ))} nav("/contact")} role="menuitem">Contact
)} ); }; // ─── FOOTER ─────────────────────────────────────────────────────────────────── const Footer = ({ navigate }) => { const nav = useCallback((p) => { navigate(p); window.scrollTo({ top: 0, behavior: "instant" }); }, [navigate]); return ( ); }; // ─── HOME PAGE ──────────────────────────────────────────────────────────────── const HomePage = ({ navigate }) => { useScrollReveal("home"); const nav = useCallback((p) => { navigate(p); window.scrollTo({ top: 0, behavior: "instant" }); }, [navigate]); const scrollTo = (id) => { document.getElementById(id)?.scrollIntoView({ behavior: "smooth" }); }; return ( <> {/* Hero */}
{/* Featured Products */}
Featured Reviews

Our Top-Rated Products

Each product is independently tested and reviewed against our rigorous evaluation criteria.

{PRODUCTS.map((p, i) => (
{p.badge}
{p.rating}

{p.name}

{p.description}

{p.category}
))} {/* Placeholder card */}
Coming Soon
Upcoming

New Review Coming

We're currently testing our next featured product. Subscribe to be notified when the review is published.

Weight Loss
{/* Categories */}
Browse by Category

Find Your Focus Area

{CATEGORIES.map((c, i) => ( ))}
{/* Why Trust Us */}
Our Process

Why You Can Trust Trusted Offer

{[ { icon: "🔬", title: "Evidence-Based Research", text: "Every ingredient is cross-referenced against clinical studies. We cite sources and explain the science in plain English." }, { icon: "🛡️", title: "Fully Independent Editorial", text: "Brands cannot pay for positive reviews. Our scores are determined solely by our evaluation criteria." }, { icon: "📋", title: "Transparent Methodology", text: "We publish our full scoring rubric — effectiveness, safety, ingredient quality, and value — so you understand every rating." }, { icon: "💬", title: "Real Consumer Feedback", text: "Ratings are informed by thousands of verified user reviews aggregated from multiple platforms." }, ].map(item => (
{item.title}
{item.text}
))}
Our Review Criteria
{[ { label: "Ingredient Quality", val: 95 }, { label: "Clinical Evidence", val: 90 }, { label: "Safety Profile", val: 96 }, { label: "Value for Money", val: 82 }, { label: "User Satisfaction", val: 88 }, ].map(item => (
{item.label} {item.val}/100
))}
4.6
Average product score across all reviews
{/* Latest Articles */}
Health Education

Latest Articles

{ARTICLES.map((a, i) => (
{a.category}

{a.title}

{a.excerpt}

📅 {a.date} ⏱ {a.read}
))}
); }; // ─── PRODUCT PAGE ───────────────────────────────────────────────────────────── const ProductPage = ({ productId, navigate }) => { const [openFaq, setOpenFaq] = useState(null); useScrollReveal(productId); const nav = useCallback((p) => { navigate(p); window.scrollTo({ top: 0, behavior: "instant" }); }, [navigate]); const product = PRODUCTS.find(p => p.id === productId); if (!product) { return (
🔍

Product Not Found

This product doesn't exist or may have been removed.

); } const { name, tagline, emoji, category, rating, reviews, score, badge, badgeType, longDesc, scores, benefits, ingredients, pros, cons, faqs } = product; const toggleFaq = (i) => setOpenFaq(prev => prev === i ? null : i); return ( <>
{emoji}
{badge}

{name}

{tagline}

{rating} ({reviews.toLocaleString()} reviews)
{/* Score card */}
Overall Score {score}/100
{Object.entries(scores).map(([k, v]) => (
{k} {v}
))}

Affiliate Disclosure: Clicking the link above may earn us a commission. This has no effect on our review score or editorial independence.

Overview

What is {name}?

{longDesc}

Our team spent over 40 hours researching {name} — analyzing the clinical evidence for each ingredient, reviewing third-party lab tests, gathering user testimonials, and evaluating the company's reputation and practices. Here's our full breakdown.

{/* Benefits */}
Benefits

Key Benefits

{benefits.map((b, i) => (
{b}
))}
{/* Ingredients */}
Formula

Ingredients

{ingredients.map((ing, i) => (
{ing}
))}
{/* Pros & Cons */}
Evaluation

Pros & Cons

✅ Pros
{pros.map((p, i) => (
{p}
))}
⚠️ Cons
{cons.map((c, i) => (
{c}
))}
{/* FAQ */}
Common Questions

Frequently Asked Questions

{faqs.map((faq, i) => (
{openFaq === i &&
{faq.a}
}
))}
{/* CTA */}
Ready to Try?

Get {name} from the Official Website

Purchasing directly from the official site ensures you receive genuine product, the best pricing, and any available money-back guarantee.

Affiliate Disclosure: We earn a commission on qualifying purchases.

); }; // ─── CATEGORY PAGE ──────────────────────────────────────────────────────────── const CategoryPage = ({ slug, navigate }) => { useScrollReveal(slug); const nav = useCallback((p) => { navigate(p); window.scrollTo({ top: 0, behavior: "instant" }); }, [navigate]); const cat = CATEGORIES.find(c => c.slug === slug) || { name: slug.replace(/-/g, " "), emoji: "🏥" }; const catProducts = PRODUCTS.filter(p => p.categorySlug === slug); return ( <>

{cat.name}

Independent reviews and recommendations for the best {cat.name.toLowerCase()} products on the market.

{catProducts.length > 0 ? (
{catProducts.map((p, i) => (
{p.badge}

{p.name}

{p.description}

{p.reviews.toLocaleString()} reviews
))}
) : (

Reviews Coming Soon

We're actively researching the best {cat.name.toLowerCase()} products. Check back soon!

)}
); }; // ─── BLOG PAGE ──────────────────────────────────────────────────────────────── const BlogPage = ({ navigate }) => { useScrollReveal("blog"); const nav = useCallback((p) => { navigate(p); window.scrollTo({ top: 0, behavior: "instant" }); }, [navigate]); return ( <>

Health & Wellness Blog

Expert-written articles on supplements, nutrition, and evidence-based health practices.

{ALL_ARTICLES.map((a, i) => (
{a.category}

{a.title}

{a.excerpt}

{a.date} · {a.read}
))}
); }; // ─── STATIC PAGES ───────────────────────────────────────────────────────────── const AboutPage = ({ navigate }) => { useScrollReveal("about"); return ( <>

About Trusted Offer

Independent reviews and recommendations for health and wellness products — built on transparency, science, and your trust.

Our Mission

Trusted Offer was founded with a simple premise: health decisions deserve honest, evidence-based information — not marketing copy. The supplement industry is flooded with exaggerated claims, cherry-picked studies, and paid endorsements. We exist to cut through the noise.

Our team of health researchers, registered dietitians, and former pharmaceutical professionals analyzes each product using a rigorous, standardized methodology. We look at the clinical evidence for every ingredient, the dosages, the manufacturing standards, and real user feedback before writing a single word of review.

Our Review Process

Every product review on Trusted Offer follows the same structured process:

  • Ingredient Research: We cross-reference each ingredient against PubMed, Cochrane Reviews, and other peer-reviewed databases.
  • Dosage Analysis: We verify that ingredient amounts match clinically studied doses.
  • Quality Verification: We check for GMP certification, third-party testing, and clean labeling.
  • User Feedback: We aggregate reviews from multiple verified sources to understand real-world experiences.
  • Value Assessment: We evaluate whether the price point is justified given what's included.

Editorial Independence

Trusted Offer participates in affiliate marketing — meaning we earn a commission when readers purchase products through our links. This is how we fund our independent research. However, we maintain a strict firewall between our commercial relationships and our editorial process. No brand can influence, preview, or change our review scores.

We regularly re-evaluate products and update scores as new evidence becomes available. If a product we recommended becomes unavailable or a better option emerges, we say so.

Our Team

Our core team includes writers with backgrounds in nutritional science, sports medicine, biochemistry, and consumer health journalism. All health-related claims on our site are reviewed by at least one qualified professional before publication.

); }; const ContactPage = () => { const [sent, setSent] = useState(false); const [form, setForm] = useState({ name: "", email: "", subject: "", message: "" }); useScrollReveal("contact"); const handleChange = (e) => setForm(prev => ({ ...prev, [e.target.name]: e.target.value })); const handleSubmit = () => { // FIX: basic validation before "sending" if (!form.name.trim() || !form.email.trim() || !form.message.trim()) return; setSent(true); }; return ( <>

Contact Us

Questions, corrections, or partnership inquiries — we'd love to hear from you.

Get in Touch

{sent ? (

Message Sent!

We'll get back to you within 1–2 business days.

) : (