"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterMedia from '@/components/sections/footer/FooterMedia';
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="text-stagger"
            defaultTextAnimation="background-highlight"
            borderRadius="soft"
            contentWidth="compact"
            sizing="largeSmallSizeMediumTitles"
            background="none"
            cardStyle="subtle-shadow"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="solid"
            headingFontWeight="bold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        brandName="Inia"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Menu", id: "menu" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Reserve Table", href: "contact" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardTwo
                            blogs={posts}
                            title="Coffee Culture Blog"
                            description="Discover the art of coffee making, brewing tips, and stories from our passionate team at Inia"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterMedia
                        imageSrc="https://img.b2bpic.net/free-photo/top-view-coffee-beans_23-2148173325.jpg"
                        imageAlt="Premium coffee beans"
                        logoText="Inia Coffee Shop"
                        copyrightText="© 2025 Inia Coffee Shop. All rights reserved."
                        columns={[
                            {
                                title: "Menu",                                items: [
                                    { label: "Espresso Drinks", href: "#" },
                                    { label: "Cold Beverages", href: "#" },
                                    { label: "Pastries & Snacks", href: "#" },
                                    { label: "Limited Editions", href: "#" }
                                ]
                            },
                            {
                                title: "Visit Us",                                items: [
                                    { label: "Hours", href: "#" },
                                    { label: "Location", href: "#" },
                                    { label: "Reservations", href: "#" },
                                    { label: "Contact", href: "#" }
                                ]
                            },
                            {
                                title: "More",                                items: [
                                    { label: "About Inia", href: "#" },
                                    { label: "Our Story", href: "#" },
                                    { label: "Sustainability", href: "#" },
                                    { label: "Press Kit", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}
