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

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

    return (
        <ThemeProvider
            defaultButtonVariant="expand-hover"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="mediumSmall"
            sizing="mediumLargeSizeLargeTitles"
            background="floatingGradient"
            cardStyle="layered-gradient"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingOverlay
                        brandName="Serene Luxury Hotel"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "Reviews", id: "reviews" }
                        ]}
                        button={{ text: "Book Now", href: "pricing" }}
                    />
                </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="Hotel Insights & Updates"
                            description="Discover the latest news, luxury travel tips, and exclusive updates from Serene Luxury Hotel"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterSimple
                        columns={[
                            {
                                title: "Navigate",                                items: [
                                    { label: "Home", href: "#hero" },
                                    { label: "Rooms", href: "#rooms" },
                                    { label: "Amenities", href: "#amenities" },
                                    { label: "Book Now", href: "#pricing" }
                                ]
                            },
                            {
                                title: "Services",                                items: [
                                    { label: "Spa & Wellness", href: "#amenities" },
                                    { label: "Restaurant", href: "#amenities" },
                                    { label: "Fitness Center", href: "#amenities" },
                                    { label: "Concierge", href: "#contact" }
                                ]
                            },
                            {
                                title: "About",                                items: [
                                    { label: "Our Story", href: "#about" },
                                    { label: "Awards", href: "#" },
                                    { label: "Careers", href: "#" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Cancellation Policy", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Serene Luxury Hotel. All rights reserved."
                        bottomRightText="Crafted with care for your comfort"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}