"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FooterSimple from '@/components/sections/footer/FooterSimple';
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="slide-background"
            defaultTextAnimation="entrance-slide"
            borderRadius="soft"
            contentWidth="medium"
            sizing="mediumSizeLargeTitles"
            background="fluid"
            cardStyle="gradient-bordered"
            primaryButtonStyle="inset-glow"
            secondaryButtonStyle="glass"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="Luxe Haven"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "About", id: "about" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Book Now", id: "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">
                        <BlogCardThree
                            blogs={posts}
                            title="Luxury Travel Stories"
                            description="Discover exceptional experiences and insider insights from Luxe Haven Resort"
                            tag="Resort Blog"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            animationType="slide-up"
                            carouselMode="buttons"
                            uniformGridCustomHeightClasses="min-h-[600px]"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterSimple
                        columns={[
                            {
                                title: "Navigate",                                items: [
                                    { label: "Rooms", href: "#rooms" },
                                    { label: "Amenities", href: "#amenities" },
                                    { label: "About", href: "#about" }
                                ]
                            },
                            {
                                title: "Guest Services",                                items: [
                                    { label: "Reservations", href: "#" },
                                    { label: "Concierge", href: "#" },
                                    { label: "Room Service", href: "#" }
                                ]
                            },
                            {
                                title: "Information",                                items: [
                                    { label: "Policies", href: "#" },
                                    { label: "Careers", href: "#" },
                                    { label: "Contact", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Luxe Haven Resort. All rights reserved."
                        bottomRightText="Designed for luxury travel experiences"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}