"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="hover-bubble"
            defaultTextAnimation="reveal-blur"
            borderRadius="soft"
            contentWidth="mediumLarge"
            sizing="largeSmall"
            background="noise"
            cardStyle="glass-depth"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="glass"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingInline
                        brandName="Maxximize"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Services", id: "services" },
                            { name: "Results", id: "results" },
                            { name: "Products", id: "products" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Start Transformation", href: "#contact" }}
                    />
                </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="Transform Your Knowledge"
                            description="Expert insights to accelerate your personal transformation journey"
                            tag="Knowledge Hub"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tagAnimation="blur-reveal"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterSimple
                        columns={[
                            {
                                title: "Navigate",                                items: [
                                    { label: "Home", href: "/" },
                                    { label: "Services", href: "#services" },
                                    { label: "Products", href: "#products" },
                                    { label: "Results", href: "#results" }
                                ]
                            },
                            {
                                title: "Resources",                                items: [
                                    { label: "Blog", href: "/blog" },
                                    { label: "FAQ", href: "#faq" },
                                    { label: "Community", href: "#" },
                                    { label: "Support", href: "#contact" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Contact Us", href: "#contact" },
                                    { label: "Disclaimer", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Maxximize. All rights reserved."
                        bottomRightText="Transforming men, one result at a time"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}