import { getProducts } from "@/lib/woocommerce"; import Header from "@/components/layout/Header"; import Footer from "@/components/layout/Footer"; import AnnouncementBar from "@/components/home/AnnouncementBar"; import NewHero from "@/components/home/NewHero"; import StatsSection from "@/components/home/StatsSection"; import FeaturesSection from "@/components/home/FeaturesSection"; import TestimonialsSection from "@/components/home/TestimonialsSection"; import NewsletterSection from "@/components/home/NewsletterSection"; export const metadata = { title: "ManoonOils - Premium Natural Oils for Hair & Skin", description: "Discover our premium collection of natural oils for hair and skin care. Handmade with love using only the finest ingredients.", }; export default async function Homepage() { let products: any[] = []; try { products = await getProducts(); } catch (e) { // Fallback for build time when API is unavailable console.log('Failed to fetch products during build'); } const featuredProduct = products.find((p) => p.status === "publish"); const publishedProducts = products .filter((p) => p.status === "publish") .slice(0, 4); return (
{/* New Hero Section */} {/* Stats & Philosophy Section */} {/* Features Section */} {/* Testimonials Section */} {/* Newsletter Section */} {/* Products Grid Section */} {publishedProducts.length > 0 && (

Our Collection

Cold-pressed, pure, and natural oils for your daily beauty routine

{publishedProducts.map((product, index) => ( ))}
)}
); } // Import ProductCard here to avoid circular dependency import ProductCard from "@/components/product/ProductCard";