"use client";

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

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
                        brandName="FitCoach"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Services", id: "features" },
                            { name: "Results", id: "metrics" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Fitness Excellence"
                        bottomRightText="hello@fitcoach.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">
                        <BlogCardOne
                            blogs={posts}
                            title="Fitness & Wellness Articles"
                            description="Expert insights on training, nutrition, and wellness to help you achieve your fitness goals"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="FitCoach"
                        copyrightText="© 2025 FitCoach | Personal Training Excellence"
                        socialLinks={[
                            {
                                icon: Instagram,
                                href: "https://instagram.com/fitcoach",                                ariaLabel: "Follow us on Instagram"
                            },
                            {
                                icon: Facebook,
                                href: "https://facebook.com/fitcoach",                                ariaLabel: "Follow us on Facebook"
                            },
                            {
                                icon: Linkedin,
                                href: "https://linkedin.com/company/fitcoach",                                ariaLabel: "Connect on LinkedIn"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}