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

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

    return (
        <ThemeProvider
            defaultButtonVariant="icon-arrow"
            defaultTextAnimation="background-highlight"
            borderRadius="rounded"
            contentWidth="medium"
            sizing="large"
            background="aurora"
            cardStyle="gradient-mesh"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        brandName="Mango"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Shop", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Collections", id: "collections" },
                            { 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="Fashion Insights"
                            description="Discover the latest trends and style tips from our fashion experts"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterCard
                        logoText="Mango"
                        copyrightText="© 2025 Mango Clothing Shop. All rights reserved."
                        socialLinks={[
                            { icon: Instagram, href: "https://instagram.com/mangofashion", ariaLabel: "Instagram" },
                            { icon: Facebook, href: "https://facebook.com/mangofashion", ariaLabel: "Facebook" },
                            { icon: Twitter, href: "https://twitter.com/mangofashion", ariaLabel: "Twitter" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}