"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, Phone, Mail } 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="circleGradient"
            cardStyle="gradient-bordered"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Shop", id: "shop" },
                            { name: "Sell With Us", id: "sell" },
                            { name: "Visit", id: "visit" },
                            { name: "FAQ", id: "faq" }
                        ]}
                        brandName="La Loupe Vintage"
                        bottomLeftText="San Diego, CA 92116"
                        bottomRightText="619-578-2944"
                    />
                </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="Vintage Chronicles"
                            description="Discover the stories behind our curated vintage finds and the timeless fashion that defines decades"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Fashion"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="La Loupe Vintage"
                        copyrightText="© 2025 La Loupe Vintage | Buy • Sell • Trade — Late 60s–90s Vintage"
                        socialLinks={[
                            {
                                icon: Instagram,
                                href: "https://www.instagram.com/laloupevintage/",                                ariaLabel: "Follow us on Instagram"
                            },
                            {
                                icon: Phone,
                                href: "tel:619-578-2944",                                ariaLabel: "Call us"
                            },
                            {
                                icon: Mail,
                                href: "mailto:info@laloupevintage.com",                                ariaLabel: "Email us"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}