"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="reveal-blur"
            borderRadius="soft"
            contentWidth="compact"
            sizing="mediumLargeSizeMediumTitles"
            background="aurora"
            cardStyle="solid"
            primaryButtonStyle="shadow"
            secondaryButtonStyle="layered"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="Giina"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Collections", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Why Giina", id: "features" },
                            { name: "Contact", id: "contact" }
                        ]}
                    />
                </div>

                {isLoading ? (
                    <div className="w-content-width mx-auto py-20 text-center">
                        <p className="text-foreground">Loading posts...</p>
                    </div>
                ) : (
                    <div id="blog" data-section="blog">
                        <BlogCardOne
                            blogs={posts}
                            title="Flower Care & Inspiration"
                            description="Discover the art of flower arrangement, care tips, and seasonal inspiration from our expert florists"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="Giina Flowers"
                        columns={[
                            {
                                title: "Collections",                                items: [
                                    { label: "All Flowers", href: "products" },
                                    { label: "Seasonal", href: "products" },
                                    { label: "Premium", href: "products" },
                                    { label: "Custom Orders", href: "contact" }
                                ]
                            },
                            {
                                title: "About",                                items: [
                                    { label: "Our Story", href: "about" },
                                    { label: "Why Choose Us", href: "features" },
                                    { label: "Testimonials", href: "testimonials" },
                                    { label: "Blog", href: "#" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "Contact Us", href: "contact" },
                                    { label: "Delivery Info", href: "#" },
                                    { label: "Care Guide", href: "#" },
                                    { label: "FAQ", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Returns", href: "#" },
                                    { label: "Sitemap", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Giina Flowers. All rights reserved with love."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}