"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from "@/components/sections/blog/BlogCardThree";
import FooterBase from "@/components/sections/footer/FooterBase";
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="shift-hover"
            defaultTextAnimation="entrance-slide"
            borderRadius="pill"
            contentWidth="small"
            sizing="largeSmallSizeLargeTitles"
            background="circleGradient"
            cardStyle="elevated"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        brandName="Savour"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Menu", id: "menu" },
                            { name: "Gallery", id: "gallery" },
                            { name: "About", id: "about" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Reservations", id: "reservations" }
                        ]}
                        button={{ text: "Book a Table", href: "reservations" }}
                    />
                </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 Insights"
                            description="Explore our latest culinary articles and cooking tips from our expert chefs"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBase
                        logoText="Savour"
                        copyrightText="© 2025 Savour Restaurant. All rights reserved."
                        columns={[
                            {
                                title: "Hours",                                items: [
                                    { label: "Monday - Thursday", href: "#" },
                                    { label: "5:00 PM - 11:00 PM", href: "#" },
                                    { label: "Friday - Saturday", href: "#" },
                                    { label: "5:00 PM - 12:00 AM", href: "#" }
                                ]
                            },
                            {
                                title: "Contact",                                items: [
                                    { label: "+1 (555) 0123", href: "tel:+1-555-0123" },
                                    { label: "reservations@savour.com", href: "mailto:reservations@savour.com" },
                                    { label: "123 Culinary Lane", href: "#" },
                                    { label: "Gourmet City, GC 12345", href: "#" }
                                ]
                            },
                            {
                                title: "Navigation",                                items: [
                                    { label: "Menu", href: "menu" },
                                    { label: "Gallery", href: "gallery" },
                                    { label: "Reservations", href: "reservations" },
                                    { label: "Contact", href: "contact" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}