"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBase from "@/components/sections/footer/FooterBase";
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="pill"
            contentWidth="mediumSmall"
            sizing="largeSizeMediumTitles"
            background="circleGradient"
            cardStyle="gradient-bordered"
            primaryButtonStyle="flat"
            secondaryButtonStyle="layered"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleApple
                        brandName="Baklajan"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Services", id: "services" },
                            { name: "Gallery", id: "gallery" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "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="Floral Insights & Inspiration"
                            description="Discover the art of floriculture through our carefully curated articles about floral design, care tips, seasonal arrangements, and the beauty of nature's creations."
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterBase
                        logoText="Baklajan"
                        copyrightText="© 2025 Baklajan Flowers Studio. All rights reserved."
                        columns={[
                            {
                                title: "Services",                                items: [
                                    { label: "Weddings", href: "services" },
                                    { label: "Events", href: "services" },
                                    { label: "Subscriptions", href: "services" },
                                    { label: "Custom Orders", href: "contact" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Gallery", href: "gallery" },
                                    { label: "Testimonials", href: "testimonials" },
                                    { label: "Contact", href: "contact" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "FAQ", href: "faq" },
                                    { label: "Delivery Info", href: "#" },
                                    { label: "Care Guide", href: "#" },
                                    { label: "Privacy Policy", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}