"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FooterBaseCard from '@/components/sections/footer/FooterBaseCard';
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="shift-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="mediumLarge"
            sizing="mediumSizeLargeTitles"
            background="circleGradient"
            cardStyle="outline"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Shop", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Stories", id: "testimonials" },
                            { name: "Contact", id: "contact" },
                            { name: "Cart", id: "cart" }
                        ]}
                        brandName="LuxeBrand"
                        bottomLeftText="Handcrafted Premium Goods"
                        bottomRightText="shop@luxebrand.com"
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardThree
                            blogs={posts}
                            title="Featured Articles"
                            description="Discover our latest insights and stories about luxury craftsmanship"
                            tag="LuxeBrand Journal"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                            uniformGridCustomHeightClasses="min-h-[600px]"
                        />
                    )}

                    <FooterBaseCard
                        logoText="LuxeBrand"
                        columns={[
                            {
                                title: "Shop",                                items: [
                                    { label: "New Arrivals", href: "#products" },
                                    { label: "Best Sellers", href: "#products" },
                                    { label: "Limited Edition", href: "#products" },
                                    { label: "Gifts", href: "#products" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Our Story", href: "#features" },
                                    { label: "Sustainability", href: "#features" },
                                    { label: "Careers", href: "#contact" }
                                ]
                            },
                            {
                                title: "Customer Care",                                items: [
                                    { label: "Contact Us", href: "#contact" },
                                    { label: "Shipping & Returns", href: "#contact" },
                                    { label: "Size Guide", href: "#contact" },
                                    { label: "Care Instructions", href: "#contact" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Instagram", href: "https://instagram.com" },
                                    { label: "Twitter", href: "https://twitter.com" },
                                    { label: "Pinterest", href: "https://pinterest.com" },
                                    { label: "Newsletter", href: "#contact" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 LuxeBrand. All rights reserved. Handcrafted with care."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}