"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterSimple from '@/components/sections/footer/FooterSimple';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="directional-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="rounded"
            contentWidth="smallMedium"
            sizing="largeSmall"
            background="circleGradient"
            cardStyle="gradient-mesh"
            primaryButtonStyle="flat"
            secondaryButtonStyle="solid"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="Sababa Kitchen"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Menu", id: "/menu" },
                            { name: "Team", id: "team" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Tel Aviv, Israel"
                        bottomRightText="reservations@sababa.com"
                    />
                </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 & News"
                            description="Discover the latest from our kitchen, featuring chef insights, seasonal ingredients, and culinary adventures from Sababa Kitchen"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterSimple
                        columns={[
                            {
                                title: "Navigate",                                items: [
                                    { label: "Home", href: "/" },
                                    { label: "About", href: "about" },
                                    { label: "Menu", href: "/menu" },
                                    { label: "Team", href: "team" }
                                ]
                            },
                            {
                                title: "Contact",                                items: [
                                    { label: "Reservations", href: "tel:+972-3-123-4567" },
                                    { label: "Email", href: "mailto:reservations@sababa.com" },
                                    { label: "Location", href: "#" },
                                    { label: "Hours", href: "#" }
                                ]
                            },
                            {
                                title: "Discover",                                items: [
                                    { label: "Our Story", href: "about" },
                                    { label: "Chef's Menu", href: "/menu" },
                                    { label: "Events", href: "#" },
                                    { label: "Catering", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Sababa Kitchen. All rights reserved."
                        bottomRightText="Made with culinary passion"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}
