"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 NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Instagram, Facebook, Linkedin } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="icon-arrow"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="smallMedium"
            sizing="medium"
            background="fluid"
            cardStyle="solid"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="glass"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        brandName="Business Colors"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Services", id: "services" },
                            { name: "Work", id: "work" },
                            { name: "Process", id: "process" },
                            { name: "Reviews", id: "reviews" },
                            { name: "FAQ", id: "faq" }
                        ]}
                        button={{ text: "Get a Quote", 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">
                        <BlogCardThree
                            blogs={posts}
                            title="Featured Articles"
                            description="Explore our latest insights and industry expertise"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            animationType="slide-up"
                            carouselMode="buttons"
                            uniformGridCustomHeightClasses="min-h-[600px]"
                            tag="Blog"
                            ariaLabel="Blog section"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="Business Colors"
                        copyrightText="© 2025 Business Colors LLC | Premium Custom Apparel & Branding"
                        socialLinks={[
                            { icon: Instagram, href: "https://instagram.com", ariaLabel: "Instagram" },
                            { icon: Facebook, href: "https://facebook.com", ariaLabel: "Facebook" },
                            { icon: Linkedin, href: "https://linkedin.com", ariaLabel: "LinkedIn" }
                        ]}
                        ariaLabel="Site footer with branding and social links"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}