"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 NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="hover-magnetic"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="mediumLarge"
            sizing="largeSmallSizeLargeTitles"
            background="none"
            cardStyle="solid"
            primaryButtonStyle="inset-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingInline
                        brandName="Hansang"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Menu", id: "menu" },
                            { name: "Experience", id: "features" },
                            { 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="Culinary Stories"
                            description="Discover the artistry behind Korean cuisine and the stories that inspire our dishes"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="Hansang"
                        columns={[
                            {
                                title: "Restaurant",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Chef's Story", href: "#team" },
                                    { label: "Menu", href: "#menu" },
                                    { label: "Reservations", href: "#contact" }
                                ]
                            },
                            {
                                title: "Visit Us",                                items: [
                                    { label: "Address: Gangnam-gu, Seoul", href: "#" },
                                    { label: "Phone: +82-2-XXXX-XXXX", href: "#" },
                                    { label: "Hours: Tue-Sun 6PM-11PM", href: "#" },
                                    { label: "Closed: Monday", href: "#" }
                                ]
                            },
                            {
                                title: "Experience",                                items: [
                                    { label: "Private Dining", href: "#" },
                                    { label: "Chef's Table", href: "#" },
                                    { label: "Omakase Menu", href: "#" },
                                    { label: "Special Events", href: "#" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Instagram", href: "https://instagram.com" },
                                    { label: "Facebook", href: "https://facebook.com" },
                                    { label: "Email", href: "mailto:info@hansang.kr" },
                                    { label: "Newsletter", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Hansang | Seoul's Premier Korean Cuisine"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}
