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

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

    return (
        <ThemeProvider
            defaultButtonVariant="slide-background"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="small"
            sizing="mediumSizeLargeTitles"
            background="none"
            cardStyle="glass-elevated"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        brandName="Skunk"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Products", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Why Us", id: "features" },
                            { name: "Reviews", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Shop Now", href: "products" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardOne
                            blogs={posts}
                            title="Latest Articles & Insights"
                            description="Discover the world of luxury fragrances through our expert insights, behind-the-scenes stories, and fragrance guides"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterCard
                        logoText="Skunk"
                        copyrightText="© 2025 Skunk Parfums. Crafted with passion and precision."
                        socialLinks={[
                            {
                                icon: Instagram,
                                href: "https://instagram.com/skunkparfums",                                ariaLabel: "Follow Skunk on Instagram"
                            },
                            {
                                icon: Twitter,
                                href: "https://twitter.com/skunkparfums",                                ariaLabel: "Follow Skunk on Twitter"
                            },
                            {
                                icon: Facebook,
                                href: "https://facebook.com/skunkparfums",                                ariaLabel: "Like Skunk on Facebook"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}