"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 NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered";
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="slide-background"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="compact"
            sizing="mediumLargeSizeLargeTitles"
            background="aurora"
            cardStyle="glass-elevated"
            primaryButtonStyle="shadow"
            secondaryButtonStyle="glass"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        brandName="Omakase Niseko"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Experience", id: "experience" },
                            { name: "Pricing", id: "pricing" },
                            { name: "Chefs", id: "team" },
                            { name: "Reviews", id: "testimonials" },
                            { name: "Reserve", id: "contact" }
                        ]}
                        button={{
                            text: "Reserve Now",                            href: "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="Culinary Stories"
                            description="Insights from our kitchen, stories from Niseko, and the art of Japanese omakase"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="Omakase Niseko"
                        columns={[
                            {
                                title: "Experience",                                items: [
                                    { label: "Our Philosophy", href: "#about" },
                                    { label: "Omakase Tiers", href: "#pricing" },
                                    { label: "The Chefs", href: "#team" },
                                    { label: "Reviews", href: "#testimonials" }
                                ]
                            },
                            {
                                title: "Reservations",                                items: [
                                    { label: "Book Now", href: "#contact" },
                                    { label: "Group Events", href: "#contact" },
                                    { label: "Private Experiences", href: "#contact" },
                                    { label: "Cancellation Policy", href: "#" }
                                ]
                            },
                            {
                                title: "Contact",                                items: [
                                    { label: "Location", href: "#" },
                                    { label: "Hours", href: "#" },
                                    { label: "Email", href: "mailto:reserve@omakase-niseko.jp" },
                                    { label: "Phone", href: "tel:+81-136-22-0008" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Instagram", href: "https://instagram.com" },
                                    { label: "Facebook", href: "https://facebook.com" },
                                    { label: "Newsletter", href: "#contact" },
                                    { label: "Blog", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Omakase Niseko. All rights reserved."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}