"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBaseCard from '@/components/sections/footer/FooterBaseCard';
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="hover-bubble"
            defaultTextAnimation="reveal-blur"
            borderRadius="rounded"
            contentWidth="small"
            sizing="largeSmallSizeLargeTitles"
            background="aurora"
            cardStyle="gradient-bordered"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="solid"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        brandName="LUMIÈRE"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Products", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Benefits", id: "features" },
                            { name: "Reviews", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Shop Now", href: "products" }}
                    />
                </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="Skincare Insights & Tips"
                            description="Discover expert advice, ingredient spotlights, and skincare routines to help you achieve radiant, healthy skin."
                            tag="Beauty Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="LUMIÈRE"
                        columns={[
                            {
                                title: "Shop",                                items: [
                                    { label: "All Products", href: "#products" },
                                    { label: "Skincare Routine", href: "#products" },
                                    { label: "Bundle Deals", href: "#products" },
                                    { label: "New Arrivals", href: "#products" }
                                ]
                            },
                            {
                                title: "Learn",                                items: [
                                    { label: "Skincare Guide", href: "#" },
                                    { label: "Ingredients", href: "#" },
                                    { label: "Blog", href: "#" },
                                    { label: "Testimonials", href: "#testimonials" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Sustainability", href: "#" },
                                    { label: "Careers", href: "#" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "FAQ", href: "#faq" },
                                    { label: "Shipping Info", href: "#" },
                                    { label: "Returns", href: "#" },
                                    { label: "Track Order", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 LUMIÈRE Skincare. All rights reserved."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}