"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="elastic-effect"
            defaultTextAnimation="entrance-slide"
            borderRadius="soft"
            contentWidth="mediumSmall"
            sizing="mediumLargeSizeLargeTitles"
            background="floatingGradient"
            cardStyle="elevated"
            primaryButtonStyle="flat"
            secondaryButtonStyle="layered"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="Family Lovers"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Team", id: "/team" },
                            { name: "Players", id: "/players" },
                            { name: "About", id: "/about" },
                            { name: "Contact", id: "/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">
                        <BlogCardTwo
                            blogs={posts}
                            title="Family Basketball Stories"
                            description="Discover the latest news, insights, and updates from the Alabama Basketball Family Lovers community"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            animationType="slide-up"
                            carouselMode="buttons"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="Family Lovers"
                        copyrightText="© 2025 Alabama Basketball Family Lovers. All rights reserved."
                        socialLinks={[
                            {
                                icon: Facebook,
                                href: "https://facebook.com/alabamabasketball",                                ariaLabel: "Facebook"
                            },
                            {
                                icon: Twitter,
                                href: "https://twitter.com/alabamahoops",                                ariaLabel: "Twitter"
                            },
                            {
                                icon: Instagram,
                                href: "https://instagram.com/alabamahoops",                                ariaLabel: "Instagram"
                            },
                            {
                                icon: Youtube,
                                href: "https://youtube.com/alabamabasketball",                                ariaLabel: "YouTube"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}