"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FooterCard from '@/components/sections/footer/FooterCard';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Instagram, Twitter, Linkedin, Youtube } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="directional-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="medium"
            sizing="mediumLarge"
            background="aurora"
            cardStyle="gradient-bordered"
            primaryButtonStyle="inset-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Training", id: "features" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        brandName="Elite Basketball Training"
                        bottomLeftText="Personalized Coaching Excellence"
                        bottomRightText="info@elitebasketballtraining.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">
                        <BlogCardThree
                            blogs={posts}
                            title="Elite Training Insights"
                            description="Discover expert basketball training tips, strategies, and insights to elevate your game to the next level"
                            tag="Basketball Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="Elite Basketball Training"
                        copyrightText="© 2025 Elite Basketball Training. All rights reserved. Elevating athletes since 2010."
                        socialLinks={[
                            { icon: Instagram, href: "https://instagram.com/elitebasketballtraining", ariaLabel: "Instagram" },
                            { icon: Twitter, href: "https://twitter.com/eliteballtrain", ariaLabel: "Twitter" },
                            { icon: Linkedin, href: "https://linkedin.com/company/elitebasketballtraining", ariaLabel: "LinkedIn" },
                            { icon: Youtube, href: "https://youtube.com/@elitebasketballtraining", ariaLabel: "YouTube" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}