"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBaseReveal from '@/components/sections/footer/FooterBaseReveal';
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="bounce-effect"
            defaultTextAnimation="entrance-slide"
            borderRadius="sharp"
            contentWidth="mediumSmall"
            sizing="mediumSizeLargeTitles"
            background="none"
            cardStyle="gradient-radial"
            primaryButtonStyle="diagonal-gradient"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingInline
                        brandName="Luxe Retreat"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "About", id: "about" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Book 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">
                        <BlogCardOne
                            blogs={posts}
                            title="Hotel Blog & News"
                            description="Stay updated with the latest news, travel tips, and insights from Luxe Retreat Hotel"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Featured"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseReveal
                        columns={[
                            {
                                title: "Hotel",                                items: [
                                    { label: "Rooms & Suites", href: "#rooms" },
                                    { label: "Amenities", href: "#amenities" },
                                    { label: "Dining", href: "https://example.com/dining" },
                                    { label: "Spa & Wellness", href: "https://example.com/spa" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Our Team", href: "https://example.com/team" },
                                    { label: "Careers", href: "https://example.com/careers" },
                                    { label: "Press", href: "https://example.com/press" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "Contact Us", href: "#contact" },
                                    { label: "FAQ", href: "https://example.com/faq" },
                                    { label: "Guest Reviews", href: "https://example.com/reviews" },
                                    { label: "Privacy Policy", href: "https://example.com/privacy" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Luxe Retreat Hotel. All rights reserved."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}