"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="elastic-effect"
            defaultTextAnimation="entrance-slide"
            borderRadius="sharp"
            contentWidth="medium"
            sizing="mediumLargeSizeLargeTitles"
            background="floatingGradient"
            cardStyle="outline"
            primaryButtonStyle="diagonal-gradient"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="SportsPicksPro"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Picks", id: "features" },
                            { name: "Pricing", id: "pricing" },
                            { name: "Success", id: "metrics" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Elite Sports Analytics"
                        bottomRightText="hello@sportspickspro.com"
                    />
                </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">
                        <BlogCardTwo
                            blogs={posts}
                            title="Expert Sports Insights"
                            description="Get the winning edge with our latest analysis, predictions, and betting strategies from professional sports analysts"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterSimple
                        columns={[
                            {
                                title: "Product",                                items: [
                                    { label: "How It Works", href: "#features" },
                                    { label: "Pricing", href: "#pricing" },
                                    { label: "Free Trial", href: "#pricing" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#" },
                                    { label: "Blog", href: "#" },
                                    { label: "Careers", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Disclaimer", href: "#" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Twitter", href: "#" },
                                    { label: "Discord", href: "#" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 SportsPicksPro. All rights reserved."
                        bottomRightText="Bet Responsibly | Verified Winners"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}