"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FooterLogoEmphasis from '@/components/sections/footer/FooterLogoEmphasis';
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="bounce-effect"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="compact"
            sizing="largeSmall"
            background="circleGradient"
            cardStyle="glass-elevated"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Flowers", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Reviews", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Order Now", href: "products" }}
                        brandName="Fiasko"
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardThree
                            blogs={posts}
                            title="Beautiful Floral Stories"
                            description="Discover the art and beauty behind our handcrafted floral arrangements"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                            tag="Our Blog"
                        />
                    )}

                    <FooterLogoEmphasis
                        logoText="Fiasko"
                        columns={[
                            {
                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Our Flowers", href: "products" },
                                    { label: "Why Choose Us", href: "features" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Customer Reviews", href: "testimonials" },
                                    { label: "FAQ", href: "faq" },
                                    { label: "Care Guide", href: "features" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Contact", href: "contact" },
                                    { label: "Delivery Info", href: "contact" },
                                    { label: "Custom Orders", href: "contact" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}