"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBase from "@/components/sections/footer/FooterBase";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="bounce-effect"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="smallMedium"
            sizing="largeSizeMediumTitles"
            background="floatingGradient"
            cardStyle="glass-elevated"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="solid"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        brandName="Billy"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Products", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Contact", id: "contact" },
                            { name: "Shop", id: "products" }
                        ]}
                        bottomLeftText="Fashion Forward"
                        bottomRightText="hello@billyclothing.com"
                    />

                    {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 Fashion Insights"
                            description="Discover the latest trends, styling tips, and fashion insights from our team at Billy"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                            buttons={[
                                { text: "View All", href: "#all" },
                                { text: "Categories", href: "#categories" }
                            ]}
                        />
                    )}

                    <FooterBase
                        logoText="Billy"
                        copyrightText="© 2025 Billy Fashion Store. All rights reserved."
                        columns={[
                            {
                                title: "Shop",                                items: [
                                    { label: "New Arrivals", href: "#products" },
                                    { label: "Best Sellers", href: "#products" },
                                    { label: "Collections", href: "#products" }
                                ]
                            },
                            {
                                title: "Customer",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Contact", href: "#contact" },
                                    { label: "FAQs", href: "#" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "Shipping Info", href: "#" },
                                    { label: "Returns", href: "#" },
                                    { label: "Size Guide", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}