"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FooterBaseReveal from '@/components/sections/footer/FooterBaseReveal';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="sharp"
            contentWidth="smallMedium"
            sizing="mediumLargeSizeLargeTitles"
            background="circleGradient"
            cardStyle="gradient-mesh"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingInline
                        brandName="Omakase Niseko"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Experience", id: "experience" },
                            { name: "About", id: "about" },
                            { name: "Reservations", id: "contact" },
                            { name: "Gallery", id: "testimonials" }
                        ]}
                        button={{ text: "Book Now", href: "#contact" }}
                        className="backdrop-blur-md bg-black/40 border border-red-900/30"
                        navItemClassName="text-white hover:text-red-400 transition-colors"
                        buttonClassName="bg-red-600 hover:bg-red-700 text-white"
                        buttonTextClassName="font-bold"
                    />
                </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">
                        <BlogCardThree
                            blogs={posts}
                            title="Culinary Stories"
                            description="Discover the artistry behind our omakase experience through stories of tradition, innovation, and seasonal mastery"
                            tag="Journal"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseReveal
                        columns={[
                            {
                                title: "Experience",                                items: [
                                    { label: "The Omakase", href: "#experience" },
                                    { label: "Our Philosophy", href: "#about" },
                                    { label: "Reservations", href: "#contact" }
                                ]
                            },
                            {
                                title: "Location",                                items: [
                                    { label: "Niseko, Hokkaido", href: "#" },
                                    { label: "Hours: 5:00 PM - 11:00 PM", href: "#" },
                                    { label: "Closed Mondays", href: "#" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Instagram", href: "https://instagram.com" },
                                    { label: "Contact", href: "#contact" },
                                    { label: "Inquiries", href: "mailto:info@omakaseniseko.com" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Omakase Niseko. All rights reserved."
                        className="w-full"
                        columnTitleClassName="text-white font-extrabold text-lg mb-4"
                        columnItemClassName="text-gray-400 hover:text-red-400 transition-colors text-sm mb-2"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}