"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="reveal-blur"
            borderRadius="sharp"
            contentWidth="compact"
            sizing="largeSmall"
            background="circleGradient"
            cardStyle="soft-shadow"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        brandName="LUXE"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Collection", id: "features" },
                            { name: "Craftsmanship", id: "about" },
                            { name: "Pricing", id: "pricing" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Reserve Now", href: "contact" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardOne
                            blogs={posts}
                            title="Luxury Insights"
                            description="Explore our curated collection of articles on craftsmanship, design, and the art of luxury living"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Editorial"
                        />
                    )}

                    <FooterSimple
                        columns={[
                            {
                                title: "Collections",                                items: [
                                    { label: "Signature", href: "#pricing" },
                                    { label: "Heritage", href: "#pricing" },
                                    { label: "Limited Editions", href: "#" }
                                ]
                            },
                            {
                                title: "About",                                items: [
                                    { label: "Our Craft", href: "#about" },
                                    { label: "Sustainability", href: "#" },
                                    { label: "Press", href: "#" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "Contact", href: "#contact" },
                                    { label: "Care Guide", href: "#" },
                                    { label: "Warranty", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Luxe Collective. All rights reserved."
                        bottomRightText="Crafted with precision. Designed for eternity."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}