"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FooterBaseCard from '@/components/sections/footer/FooterBaseCard';
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="elastic-effect"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="compact"
            sizing="mediumLarge"
            background="circleGradient"
            cardStyle="glass-elevated"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Menu", id: "menu" },
                            { name: "Gallery", id: "gallery" },
                            { name: "Reserve", id: "reservation" },
                            { name: "Contact", id: "contact" }
                        ]}
                        brandName="Culinary Haven"
                        bottomLeftText="Fine Dining Experience"
                        bottomRightText="info@culinaryhaven.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">
                        <BlogCardThree
                            blogs={posts}
                            title="Culinary Chronicles"
                            description="Discover the stories behind our dishes, cooking techniques, and culinary inspirations from our kitchen to your table"
                            tag="Our Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                            uniformGridCustomHeightClasses="min-h-[600px]"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="Culinary Haven"
                        columns={[
                            {
                                title: "Restaurant",                                items: [
                                    { label: "Our Menu", href: "#menu" },
                                    { label: "Reserve Table", href: "#reservation" },
                                    { label: "Gallery", href: "#gallery" },
                                    { label: "Private Events", href: "#" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Our Team", href: "#" },
                                    { label: "Blog", href: "#" },
                                    { label: "Careers", href: "#" }
                                ]
                            },
                            {
                                title: "Contact",                                items: [
                                    { label: "Phone: (555) 123-4567", href: "tel:+15551234567" },
                                    { label: "Email: info@culinaryhaven.com", href: "mailto:info@culinaryhaven.com" },
                                    { label: "123 Gastronomy Lane", href: "#" },
                                    { label: "Hours: Tues-Sun 5-10pm", href: "#" }
                                ]
                            },
                            {
                                title: "Follow",                                items: [
                                    { label: "Instagram", href: "#" },
                                    { label: "Facebook", href: "#" },
                                    { label: "Twitter", href: "#" },
                                    { label: "Newsletter", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Culinary Haven. All rights reserved."
                        onPrivacyClick={null}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}