"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="icon-arrow"
            defaultTextAnimation="background-highlight"
            borderRadius="sharp"
            contentWidth="small"
            sizing="mediumSizeLargeTitles"
            background="circleGradient"
            cardStyle="outline"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="layered"
            headingFontWeight="bold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarLayoutFloatingOverlay
                        brandName="Zayia"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Products", id: "/shop" },
                            { name: "About", id: "about" },
                            { name: "FAQ", id: "faq" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Order Now", href: "/shop" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardTwo
                            blogs={posts}
                            title="Flower Care & Inspiration"
                            description="Discover tips, seasonal guides, and stories behind our beautiful arrangements"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterSimple
                        columns={[
                            {
                                title: "Shop",                                items: [
                                    { label: "All Flowers", href: "#" },
                                    { label: "Seasonal", href: "#" },
                                    { label: "Custom Orders", href: "#" },
                                    { label: "Gift Cards", href: "#" }
                                ]
                            },
                            {
                                title: "About",                                items: [
                                    { label: "Our Story", href: "#" },
                                    { label: "Our Team", href: "#" },
                                    { label: "Sustainability", href: "#" },
                                    { label: "Blog", href: "#" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "Contact Us", href: "#" },
                                    { label: "Delivery Info", href: "#" },
                                    { label: "FAQ", href: "faq" },
                                    { label: "Flower Care", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Return Policy", href: "#" },
                                    { label: "Contact", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Zayia Flowers. All rights reserved."
                        bottomRightText="Crafted with care and passion for beautiful moments."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}