"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterMedia from '@/components/sections/footer/FooterMedia';
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="slide-background"
            defaultTextAnimation="reveal-blur"
            borderRadius="pill"
            contentWidth="mediumSmall"
            sizing="mediumLarge"
            background="grid"
            cardStyle="outline"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="glass"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        brandName="KIMCHI & CO"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Menu", id: "menu" },
                            { name: "About", id: "about" },
                            { name: "Experience", id: "features" },
                            { name: "Specials", id: "products" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Reserve Now", href: "contact" }}
                    />
                </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="Korean Culinary Stories"
                            description="Discover the rich traditions and flavors behind our authentic Korean dishes"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tagAnimation="slide-up"
                            buttonAnimation="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterMedia
                        imageSrc="https://img.b2bpic.net/free-psd/authentic-korean-bibimbap-bowl-with-fried-egg-assorted-vegetables_84443-64212.jpg"
                        imageAlt="Korean dining"
                        logoText="KIMCHI & CO"
                        copyrightText="© 2025 Kimchi & Co. All rights reserved. Crafted with passion in Seoul."
                        columns={[
                            {
                                title: "Restaurant",                                items: [
                                    { label: "Menu", href: "#menu" },
                                    { label: "Reservations", href: "#contact" },
                                    { label: "Private Events", href: "#" },
                                    { label: "Catering", href: "#" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Instagram", href: "https://instagram.com" },
                                    { label: "Facebook", href: "https://facebook.com" },
                                    { label: "Email Us", href: "mailto:info@kimchiandco.kr" },
                                    { label: "Phone", href: "tel:+82-2-1234-5678" }
                                ]
                            },
                            {
                                title: "Location",                                items: [
                                    { label: "Gangnam District", href: "#" },
                                    { label: "Directions", href: "#" },
                                    { label: "Contact", href: "#contact" },
                                    { label: "About Us", href: "#about" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}