"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
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="text-shift"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="medium"
            sizing="mediumLargeSizeMediumTitles"
            background="aurora"
            cardStyle="subtle-shadow"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="glass"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="Prime Cut"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Menu", id: "features" },
                            { name: "Experience", id: "experience" },
                            { name: "Reviews", id: "testimonials" },
                            { name: "Reserve", id: "contact" }
                        ]}
                        bottomLeftText="New York, NY"
                        bottomRightText="reservations@primecut.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">
                        <BlogCardTwo
                            blogs={posts}
                            title="Culinary Chronicles"
                            description="Discover the stories behind our exceptional dining experiences and culinary craftsmanship"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="Prime Cut"
                        copyrightText="© 2025 Prime Cut Steakhouse. All rights reserved."
                        columns={[
                            {
                                title: "Restaurant",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Menu", href: "#features" },
                                    { label: "Experiences", href: "#experience" },
                                    { label: "Reviews", href: "#testimonials" }
                                ]
                            },
                            {
                                title: "Dining",                                items: [
                                    { label: "Make Reservation", href: "#contact" },
                                    { label: "Private Events", href: "#contact" },
                                    { label: "Gift Cards", href: "#" },
                                    { label: "Wine Cellar", href: "#experience" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "Contact", href: "#contact" },
                                    { label: "FAQ", href: "#faq" },
                                    { label: "Careers", href: "#" },
                                    { label: "Blog", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Cookie Policy", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}