"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBaseReveal from "@/components/sections/footer/FooterBaseReveal";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered";
import { useBlogPosts } from "@/hooks/useBlogPosts";

export default function BlogPage() {
    const { posts, isLoading } = useBlogPosts();

    return (
        <ThemeProvider
            defaultButtonVariant="directional-hover"
            defaultTextAnimation="entrance-slide"
            borderRadius="soft"
            contentWidth="compact"
            sizing="mediumLarge"
            background="floatingGradient"
            cardStyle="inset"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Products", id: "products" },
                            { name: "Benefits", id: "features" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Shop Now", href: "products" }}
                        brandName="Luxe Botanics"
                    />
                </div>

                {isLoading ? (
                    <div className="w-content-width mx-auto py-20 text-center">
                        <p className="text-foreground">Loading posts...</p>
                    </div>
                ) : (
                    <div id="blog" data-section="blog">
                        <BlogCardOne
                            blogs={posts}
                            title="Beauty & Wellness Insights"
                            description="Discover expert tips, ingredient spotlights, and sustainable beauty practices from our team of skincare specialists"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseReveal
                        columns={[
                            {
                                title: "Shop",                                items: [
                                    { label: "All Products", href: "products" },
                                    { label: "Serums", href: "#" },
                                    { label: "Moisturizers", href: "#" },
                                    { label: "Masks & Treatments", href: "#" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Our Story", href: "#" },
                                    { label: "Sustainability", href: "#" },
                                    { label: "Careers", href: "#" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "Contact Us", href: "#" },
                                    { label: "FAQ", href: "faq" },
                                    { label: "Shipping & Returns", href: "#" },
                                    { label: "Privacy Policy", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Luxe Botanics. All rights reserved. Crafted with purpose, delivered with luxury."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}