"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="rounded"
            contentWidth="small"
            sizing="largeSmall"
            background="grid"
            cardStyle="gradient-bordered"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="Loras Family Restaurant"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "What to Order", id: "what-to-order" },
                            { name: "Menu", id: "menu" },
                            { name: "Visit", id: "visit" },
                            { name: "Reviews", id: "reviews" },
                            { name: "Call Now", id: "tel:+1-555-0100" }
                        ]}
                    />
                </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="Latest from Our Kitchen"
                            description="Discover delicious recipes, family stories, and the heart behind every dish we serve"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                            tagAnimation="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="Loras Family Restaurant"
                        copyrightText="© 2025 Loras Family Restaurant | Fresh • Affordable • Family-Friendly | Cash or Check Only"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}