"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from "@/components/sections/blog/BlogCardTwo";
import FooterBase from "@/components/sections/footer/FooterBase";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="slide-background"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="mediumLarge"
            sizing="largeSmallSizeLargeTitles"
            background="circleGradient"
            cardStyle="gradient-bordered"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="solid"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="Luxury Hotel"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "About", id: "about" },
                            { name: "Contact", id: "contact" },
                            { name: "Book Now", id: "booking" }
                        ]}
                        bottomLeftText="Premium Hospitality"
                        bottomRightText="reservations@luxuryhotel.com"
                    />
                </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="Latest Hotel News"
                            description="Stay informed with our latest updates, exclusive offers, and hospitality insights"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBase
                        logoText="Luxury Hotel"
                        copyrightText="© 2025 Luxury Hotel. All rights reserved."
                        columns={[
                            {
                                title: "Rooms",                                items: [
                                    { label: "Deluxe Rooms", href: "rooms" },
                                    { label: "Suites", href: "rooms" },
                                    { label: "Penthouses", href: "rooms" }
                                ]
                            },
                            {
                                title: "Services",                                items: [
                                    { label: "Restaurant", href: "amenities" },
                                    { label: "Spa & Wellness", href: "amenities" },
                                    { label: "Events & Meetings", href: "amenities" }
                                ]
                            },
                            {
                                title: "Information",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Contact", href: "contact" },
                                    { label: "Privacy Policy", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}